public class FNPPacketMangler extends java.lang.Object implements OutgoingPacketMangler
IncomingPacketFilter,
NewPacketFormat| Modifier and Type | Field and Description |
|---|---|
static int |
AMOUNT_OF_BYTES_ALLOWED_BEFORE_WE_REKEY
The amount of data sent before we ask for a rekey
|
static int |
DH_CONTEXT_BUFFER_SIZE |
static int |
DH_GENERATION_INTERVAL |
static long |
MAX_SESSION_KEY_REKEYING_DELAY
The max amount of time we will accept to use the current tracker when it should have been replaced
|
static long |
SESSION_KEY_REKEYING_INTERVAL
The rekeying interval for the session key (keytrackers)
|
static long |
TRANSIENT_KEY_REKEYING_MIN_INTERVAL |
| Constructor and Description |
|---|
FNPPacketMangler(Node node,
NodeCrypto crypt,
PacketSocketHandler sock) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
allowConnection(PeerNode pn,
FreenetInetAddress addr)
Is there any reason not to allow this connection? E.g.
|
boolean |
alwaysAllowLocalAddresses()
Always allow local addresses?
|
byte[] |
getCompressedNoderef()
Get our compressed noderef
|
AddressTracker.Status |
getConnectivityStatus()
Port forwarding status.
|
Peer[] |
getPrimaryIPAddress()
Get our addresses, as peers.
|
SocketHandler |
getSocketHandler()
The SocketHandler we are connected to.
|
boolean |
isDisconnected(PeerContext context)
Is a peer disconnected?
|
IncomingPacketFilter.DECODED |
process(byte[] buf,
int offset,
int length,
Peer peer,
PeerNode opn,
long now)
Decrypt and authenticate packet.
|
void |
sendHandshake(PeerNode pn,
boolean notRegistered)
Send a handshake, if possible, to the node.
|
void |
setPortForwardingBroken()
If the lower level code detects the port forwarding is broken, it will call this method.
|
void |
start()
Start up the FNPPacketMangler.
|
int[] |
supportedNegTypes(boolean forPublic)
List of supported negotiation types in preference order (best last)
|
public static final int DH_GENERATION_INTERVAL
public static final int DH_CONTEXT_BUFFER_SIZE
public static final long TRANSIENT_KEY_REKEYING_MIN_INTERVAL
public static final long SESSION_KEY_REKEYING_INTERVAL
public static final long MAX_SESSION_KEY_REKEYING_DELAY
public static final int AMOUNT_OF_BYTES_ALLOWED_BEFORE_WE_REKEY
public FNPPacketMangler(Node node, NodeCrypto crypt, PacketSocketHandler sock)
public void start()
public IncomingPacketFilter.DECODED process(byte[] buf, int offset, int length, Peer peer, PeerNode opn, long now)
public void sendHandshake(PeerNode pn, boolean notRegistered)
OutgoingPacketManglersendHandshake in interface OutgoingPacketManglerpublic boolean isDisconnected(PeerContext context)
OutgoingPacketManglerisDisconnected in interface OutgoingPacketManglerpublic int[] supportedNegTypes(boolean forPublic)
OutgoingPacketManglersupportedNegTypes in interface OutgoingPacketManglerpublic SocketHandler getSocketHandler()
OutgoingPacketManglergetSocketHandler in interface OutgoingPacketManglerpublic Peer[] getPrimaryIPAddress()
OutgoingPacketManglergetPrimaryIPAddress in interface OutgoingPacketManglerpublic byte[] getCompressedNoderef()
OutgoingPacketManglergetCompressedNoderef in interface OutgoingPacketManglerpublic boolean alwaysAllowLocalAddresses()
OutgoingPacketMangleralwaysAllowLocalAddresses in interface OutgoingPacketManglerpublic AddressTracker.Status getConnectivityStatus()
OutgoingPacketManglergetConnectivityStatus in interface OutgoingPacketManglerpublic boolean allowConnection(PeerNode pn, FreenetInetAddress addr)
OutgoingPacketManglerallowConnection in interface OutgoingPacketManglerpublic void setPortForwardingBroken()
OutgoingPacketManglersetPortForwardingBroken in interface OutgoingPacketMangler