Package org.opennms.jicmp.jna
Class SunV6NativeSocket
- java.lang.Object
-
- org.opennms.jicmp.jna.NativeDatagramSocket
-
- org.opennms.jicmp.jna.SunV6NativeSocket
-
- All Implemented Interfaces:
AutoCloseable
public class SunV6NativeSocket 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 SunV6NativeSocket(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, sun_sockaddr_in6 address, int address_len)
void
close()
int
close(int socket)
int
getSock()
int
receive(NativeDatagramPacket p)
int
recvfrom(int socket, Buffer buffer, int buflen, int flags, sun_sockaddr_in6 in_addr, int[] in_addr_len)
int
send(NativeDatagramPacket p)
int
sendto(int socket, Buffer buffer, int buflen, int flags, sun_sockaddr_in6 dest_addr, int dest_addr_len)
int
setsockopt(int socket, int level, int option_name, com.sun.jna.Pointer value, int option_len)
void
setTrafficClass(int tc)
int
socket(int domain, int type, int protocol)
-
Methods inherited from class org.opennms.jicmp.jna.NativeDatagramSocket
allowFragmentation, create, strerror
-
-
-
-
Method Detail
-
bind
public int bind(int socket, sun_sockaddr_in6 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
-
setsockopt
public int setsockopt(int socket, int level, int option_name, com.sun.jna.Pointer value, int option_len)
- Overrides:
setsockopt
in classNativeDatagramSocket
-
sendto
public int sendto(int socket, Buffer buffer, int buflen, int flags, sun_sockaddr_in6 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, sun_sockaddr_in6 in_addr, int[] in_addr_len) 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
-
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) throws UnknownHostException
- Specified by:
receive
in classNativeDatagramSocket
- Throws:
UnknownHostException
-
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
-
getSock
public int getSock()
- Specified by:
getSock
in classNativeDatagramSocket
-
-