Exemple #1
0
 /**
  * Takes an IPv4 Internet address and returns string representing the address in `.' notation
  *
  * @param in the opaque bytes of an IPv4 "struct in_addr"
  * @return String
  */
 public String inet_ntop(int in) {
   Pointer charBuf = new Pointer(Socket.INET_ADDRSTRLEN);
   IntByReference addrBuf = new IntByReference(in); // the addr is passed by value (to handle IPv6)
   String result = sockets.inet_ntop(Socket.AF_INET, addrBuf, charBuf, Socket.INET_ADDRSTRLEN);
   addrBuf.free();
   charBuf.free();
   return result;
 }