Package org.opennms.jicmp.jna
Class Win32V4NativeSocket
- java.lang.Object
-
- org.opennms.jicmp.jna.NativeDatagramSocket
-
- org.opennms.jicmp.jna.Win32V4NativeSocket
-
- All Implemented Interfaces:
AutoCloseable
public class Win32V4NativeSocket extends NativeDatagramSocket
UnixNativeSocketFactory- Author:
- brozow
-
-
Field Summary
-
Fields inherited from class org.opennms.jicmp.jna.NativeDatagramSocket
AF_INET, AF_INET6, IP_MTU_DISCOVER, IPPROTO_ICMP, IPPROTO_ICMPV6, IPPROTO_IP, IPPROTO_IPV6, IPPROTO_UDP, IPV6_DONTFRAG, PF_INET, PF_INET6, SOCK_DGRAM, SOCK_RAW
-
-
Constructor Summary
Constructors Constructor Description Win32V4NativeSocket(int family, int type, int protocol, int listenPort)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
allowFragmentation(boolean frag)
int
bind(int socket, sockaddr_in address, int address_len)
void
close()
int
close(int socket)
int
closesocket(int socket)
int
getSock()
int
receive(NativeDatagramPacket p)
int
recvfrom(int socket, Buffer buffer, int buflen, int flags, sockaddr_in in_addr, int[] in_addr_len)
int
send(NativeDatagramPacket p)
int
sendto(int socket, Buffer buffer, int buflen, int flags, sockaddr_in dest_addr, int dest_addr_len)
void
setTrafficClass(int tc)
int
socket(int domain, int type, int protocol)
-
Methods inherited from class org.opennms.jicmp.jna.NativeDatagramSocket
allowFragmentation, create, setsockopt, strerror
-
-
-
-
Method Detail
-
bind
public int bind(int socket, sockaddr_in address, int address_len) throws com.sun.jna.LastErrorException
- Throws:
com.sun.jna.LastErrorException
-
socket
public int socket(int domain, int type, int protocol) throws com.sun.jna.LastErrorException
- Throws:
com.sun.jna.LastErrorException
-
sendto
public int sendto(int socket, Buffer buffer, int buflen, int flags, sockaddr_in dest_addr, int dest_addr_len) throws com.sun.jna.LastErrorException
- Throws:
com.sun.jna.LastErrorException
-
recvfrom
public int recvfrom(int socket, Buffer buffer, int buflen, int flags, sockaddr_in in_addr, int[] in_addr_len) throws com.sun.jna.LastErrorException
- Throws:
com.sun.jna.LastErrorException
-
closesocket
public int closesocket(int socket) throws com.sun.jna.LastErrorException
- Throws:
com.sun.jna.LastErrorException
-
close
public int close(int socket) throws com.sun.jna.LastErrorException
- Throws:
com.sun.jna.LastErrorException
-
getSock
public int getSock()
- Specified by:
getSock
in classNativeDatagramSocket
-
setTrafficClass
public void setTrafficClass(int tc) throws com.sun.jna.LastErrorException
- Specified by:
setTrafficClass
in classNativeDatagramSocket
- Throws:
com.sun.jna.LastErrorException
-
allowFragmentation
public void allowFragmentation(boolean frag) throws IOException
- Specified by:
allowFragmentation
in classNativeDatagramSocket
- Throws:
IOException
-
receive
public int receive(NativeDatagramPacket p)
- Specified by:
receive
in classNativeDatagramSocket
-
send
public int send(NativeDatagramPacket p)
- Specified by:
send
in classNativeDatagramSocket
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in classNativeDatagramSocket
-
-