|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.net.DatagramSocket nl.openfortress.socket6bed4.ServerNode
public class ServerNode
Each ServerNode instance serves a connection to a particular 6bed4 tunnel server. This is reflected by its superclass, which is the principal address serviced -- the IPv4 address and UDP port for the server. As part of the service for a node, there is a neighbor cache. This may be compared to having a per-network neighbor cache as part of an operating system. Lookups may lead to more direct routes than would otherwise be possible. TODO: Hook up handle_4to6/handle_6to4 methods with receive/send. TODO: Handle IPv6 addr chg by throwing an IOException subclass. TODO: Establish NeighborCache with lladdr_6bed4, somehow.
Field Summary | |
---|---|
protected nl.openfortress.socket6bed4.NeighborCache |
ngbcache
|
protected Inet6Address |
sharedAddress
|
protected InetSocketAddress |
tunserver
|
Constructor Summary | |
---|---|
ServerNode(InetSocketAddress isa)
Create a connection to a 6bed4 tunnel server, and keep it active. |
Method Summary | |
---|---|
void |
acknowledge_playful(byte[] addr,
int ofs)
Acknowledge a playful exchange to the Neighbor Cache. |
Inet6Address |
getShared6bed4Address()
Return the shared 6bed4 address, usable for anyone who wants to allocate ports for UDP/TCP through either a Socket6bed4 or a DatagramSocket6bed4. |
Inet6Address |
getUnique6bed4Address(BlockingQueue<byte[]> recv_TODO_OR_KEEP_INTERNAL)
Return a unique 6bed4 address, which is available for raw communication over IPv6. |
void |
handle_4to6_nd(byte[] pkt,
int pktlen,
SocketAddress src)
|
void |
handle_4to6_plain(byte[] pkt,
int pktlen)
|
void |
handle_4to6(DatagramPacket datagram)
Handle a 6bed4 packet that is being stripped and passed on as an IPv6 packet. |
void |
handle_6to4_nd(byte[] pkt,
int pktlen)
|
void |
handle_6to4_plain_unicast(byte[] pkt,
int pktlen)
|
void |
handle_6to4(byte[] pkt,
int pktlen)
|
InetSocketAddress |
lookup_neighbor(Inet6Address ia,
boolean playful)
Lookup a neighbor. |
byte[] |
receive_datagram(int port,
int timeout)
Pull an element from the BlockingQueue for the given Datagram port. |
void |
registerDatagramClient(int port)
|
void |
stop()
Teardown the connection to a 6bed4 tunnel server. |
void |
unregisterDatagramClient(int port)
|
boolean |
useLess()
Decrement the use counter, return if it is now useless |
void |
useMore()
Increment the use counter |
void |
validate_originator(byte[] pkt,
InetSocketAddress originator)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected InetSocketAddress tunserver
protected nl.openfortress.socket6bed4.NeighborCache ngbcache
protected Inet6Address sharedAddress
Constructor Detail |
---|
public ServerNode(InetSocketAddress isa) throws SocketException
SocketException
Method Detail |
---|
public void stop()
public void useMore()
public boolean useLess()
public void registerDatagramClient(int port) throws SocketException
SocketException
public void unregisterDatagramClient(int port) throws SocketException
SocketException
public Inet6Address getShared6bed4Address()
public Inet6Address getUnique6bed4Address(BlockingQueue<byte[]> recv_TODO_OR_KEEP_INTERNAL)
public byte[] receive_datagram(int port, int timeout) throws SocketException
SocketException
public void acknowledge_playful(byte[] addr, int ofs)
public InetSocketAddress lookup_neighbor(Inet6Address ia, boolean playful)
public void handle_4to6_nd(byte[] pkt, int pktlen, SocketAddress src) throws IOException, SocketException
IOException
SocketException
public void handle_4to6_plain(byte[] pkt, int pktlen) throws IOException
IOException
public void handle_4to6(DatagramPacket datagram) throws IOException
IOException
public void validate_originator(byte[] pkt, InetSocketAddress originator) throws IOException
IOException
public void handle_6to4_plain_unicast(byte[] pkt, int pktlen) throws IOException
IOException
public void handle_6to4_nd(byte[] pkt, int pktlen) throws IOException
IOException
public void handle_6to4(byte[] pkt, int pktlen) throws IOException
IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |