Package net.i2p.router.transport.udp
Class PacketBuilder
- java.lang.Object
-
- net.i2p.router.transport.udp.PacketBuilder
-
class PacketBuilder extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PacketBuilder.Fragment
Class for passing multiple fragments to buildPacket()
-
Field Summary
Fields Modifier and Type Field Description static int
ABSOLUTE_MAX_ACKS
one byte fieldstatic int
DATA_HEADER_SIZE
not including acks.static int
FRAGMENT_HEADER_SIZE
4 byte msg ID + 3 byte fragment infostatic int
HEADER_SIZE
if no extended options or rekey data, which we don't support = 37static int
IP_HEADER_SIZE
IPv4 onlystatic int
IPV6_HEADER_SIZE
static int
MIN_DATA_PACKET_OVERHEAD
74static int
MIN_IPV6_DATA_PACKET_OVERHEAD
94(package private) static int
PRIORITY_HIGH
(package private) static int
TYPE_ACK
(package private) static int
TYPE_CONF
(package private) static int
TYPE_CREAT
(package private) static int
TYPE_FIRST
For debugging and stats only - does not go out on the wire.(package private) static int
TYPE_INTRO
(package private) static int
TYPE_PUNCH
(package private) static int
TYPE_RESP
(package private) static int
TYPE_RREQ
(package private) static int
TYPE_SREQ
(package private) static int
TYPE_TBC
(package private) static int
TYPE_TCB
(package private) static int
TYPE_TFA
(package private) static int
TYPE_TTA
static int
UDP_HEADER_SIZE
Same for IPv4 and IPv6
-
Constructor Summary
Constructors Constructor Description PacketBuilder()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
getMaxAdditionalFragmentSize(PeerState peer, int numFragments, int curDataSize)
Will a packet to 'peer' that already has 'numFragments' fragments totalling 'curDataSize' bytes fit another fragment of size 'newFragSize' ?? This doesn't leave anything for acks.
-
-
-
Field Detail
-
TYPE_FIRST
static final int TYPE_FIRST
For debugging and stats only - does not go out on the wire. These are chosen to be higher than the highest I2NP message type, as a data packet is set to the underlying I2NP message type.- See Also:
- Constant Field Values
-
TYPE_ACK
static final int TYPE_ACK
- See Also:
- Constant Field Values
-
TYPE_PUNCH
static final int TYPE_PUNCH
- See Also:
- Constant Field Values
-
TYPE_RESP
static final int TYPE_RESP
- See Also:
- Constant Field Values
-
TYPE_INTRO
static final int TYPE_INTRO
- See Also:
- Constant Field Values
-
TYPE_RREQ
static final int TYPE_RREQ
- See Also:
- Constant Field Values
-
TYPE_TCB
static final int TYPE_TCB
- See Also:
- Constant Field Values
-
TYPE_TBC
static final int TYPE_TBC
- See Also:
- Constant Field Values
-
TYPE_TTA
static final int TYPE_TTA
- See Also:
- Constant Field Values
-
TYPE_TFA
static final int TYPE_TFA
- See Also:
- Constant Field Values
-
TYPE_CONF
static final int TYPE_CONF
- See Also:
- Constant Field Values
-
TYPE_SREQ
static final int TYPE_SREQ
- See Also:
- Constant Field Values
-
TYPE_CREAT
static final int TYPE_CREAT
- See Also:
- Constant Field Values
-
HEADER_SIZE
public static final int HEADER_SIZE
if no extended options or rekey data, which we don't support = 37- See Also:
- Constant Field Values
-
FRAGMENT_HEADER_SIZE
public static final int FRAGMENT_HEADER_SIZE
4 byte msg ID + 3 byte fragment info- See Also:
- Constant Field Values
-
DATA_HEADER_SIZE
public static final int DATA_HEADER_SIZE
not including acks. 46- See Also:
- Constant Field Values
-
IP_HEADER_SIZE
public static final int IP_HEADER_SIZE
IPv4 only- See Also:
- Constant Field Values
-
UDP_HEADER_SIZE
public static final int UDP_HEADER_SIZE
Same for IPv4 and IPv6- See Also:
- Constant Field Values
-
MIN_DATA_PACKET_OVERHEAD
public static final int MIN_DATA_PACKET_OVERHEAD
74- See Also:
- Constant Field Values
-
IPV6_HEADER_SIZE
public static final int IPV6_HEADER_SIZE
- See Also:
- Constant Field Values
-
MIN_IPV6_DATA_PACKET_OVERHEAD
public static final int MIN_IPV6_DATA_PACKET_OVERHEAD
94- See Also:
- Constant Field Values
-
ABSOLUTE_MAX_ACKS
public static final int ABSOLUTE_MAX_ACKS
one byte field- See Also:
- Constant Field Values
-
PRIORITY_HIGH
static final int PRIORITY_HIGH
- See Also:
- Constant Field Values
-
-
Method Detail
-
getMaxAdditionalFragmentSize
public static int getMaxAdditionalFragmentSize(PeerState peer, int numFragments, int curDataSize)
Will a packet to 'peer' that already has 'numFragments' fragments totalling 'curDataSize' bytes fit another fragment of size 'newFragSize' ?? This doesn't leave anything for acks.- Parameters:
numFragments
- >= 1- Since:
- 0.9.16
-
-