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)
OutgoingPacketMangler
sendHandshake
in interface OutgoingPacketMangler
public boolean isDisconnected(PeerContext context)
OutgoingPacketMangler
isDisconnected
in interface OutgoingPacketMangler
public int[] supportedNegTypes(boolean forPublic)
OutgoingPacketMangler
supportedNegTypes
in interface OutgoingPacketMangler
public SocketHandler getSocketHandler()
OutgoingPacketMangler
getSocketHandler
in interface OutgoingPacketMangler
public Peer[] getPrimaryIPAddress()
OutgoingPacketMangler
getPrimaryIPAddress
in interface OutgoingPacketMangler
public byte[] getCompressedNoderef()
OutgoingPacketMangler
getCompressedNoderef
in interface OutgoingPacketMangler
public boolean alwaysAllowLocalAddresses()
OutgoingPacketMangler
alwaysAllowLocalAddresses
in interface OutgoingPacketMangler
public AddressTracker.Status getConnectivityStatus()
OutgoingPacketMangler
getConnectivityStatus
in interface OutgoingPacketMangler
public boolean allowConnection(PeerNode pn, FreenetInetAddress addr)
OutgoingPacketMangler
allowConnection
in interface OutgoingPacketMangler
public void setPortForwardingBroken()
OutgoingPacketMangler
setPortForwardingBroken
in interface OutgoingPacketMangler