#include <math.h>
Go to the source code of this file.
Defines | |
#define | PEEK_A_BOOTY_VERSION "0.7.5.3" |
#define | PB_OK (0) |
#define | PB_ERROR (-1) |
#define | PB_BAD_SERVICE (-2) |
#define | PB_BAD_ADDRESS (-3) |
#define | PB_UNREACHABLE (-4) |
#define | PB_NOT_CONNECTED (-5) |
#define | PB_UNIMPLEMENTED (-6) |
#define | DEFAULT_CONNECTION_TYPE ConnectionInterface::TCP_CONNECTION |
Default connection type. More... | |
#define | REQUESTED_SOCKET_VERSION 2,2 |
Used by windows to identify the current socket version. More... | |
#define | DEFAULT_SERVER_CERTIFICATE_FILE "server_certificate.pem" |
Default certificate file name (for SSL). More... | |
#define | DEFAULT_SERVER_PRIVATE_KEY_FILE "server_private_key.pem" |
Default server private key file. More... | |
#define | DEFAULT_SERVER_PRIVATE_KEY_PASSWORD "peekabooty-server" |
Default private key password used to secure the server private key file. More... | |
#define | DEFAULT_CLIENT_CERTIFICATE_FILE "client_certificate.pem" |
Default certificate file name (for SSL). More... | |
#define | DEFAULT_CLIENT_PRIVATE_KEY_FILE "client_private_key.pem" |
Default server private key file. More... | |
#define | DEFAULT_CLIENT_PRIVATE_KEY_PASSWORD "peekabooty-client" |
Default private key password used to secure the client private key file. More... | |
#define | DEFAULT_OPENSSL_CONFIGURATION_FILE "openssl.cnf" |
Default OpenSSL configuration file. More... | |
#define | DEFAULT_OPENSSL_PATH "." |
Default path to openssl files. More... | |
#define | DEFAULT_CONFIG_FILE "pb.cfg" |
Default configuration file name. More... | |
#define | DEFAULT_HOST_FILE "host.lst" |
Default file that contains the host list. More... | |
#define | DELIM "=" |
For configuration/synchronization files. This is what separates a variable name from its value. More... | |
#define | PROMPT ("PaB " PEEK_A_BOOTY_VERSION ">") |
The prompt for the command line. More... | |
#define | MAXINT 2147483647 |
The maximum size of a 4 byte signed integer. More... | |
#define | S_UCHAR 1 |
Size (in bytes) of an unsigned character. More... | |
#define | S_USHORT 2 |
Size (in bytes) of an unsigned short. More... | |
#define | S_UINT 4 |
Size (in bytes) of an unsigned int. More... | |
#define | min(a, b) (a>b?b:a) |
Variables | |
const int | DEFAULT_PORT = 443 |
Default port number to listen on. More... | |
const int | MAX_CONNECTIONS = 16 |
Max number of simultaneous connections. More... | |
const int | MIN_CONNECTIONS = 10 |
Minimum number of simultaneous connections. More... | |
const int | MAX_HOST_LIST_SIZE = 128 |
Maximum length of host list. More... | |
const int | VERSION_NUMBER = 0x01 |
Version number of the protocol (range 0-15). More... | |
const int | MAX_HEADER_LENGTH = 30 |
Maximum header length in bytes. More... | |
const int | MIN_HEADER_LENGTH = 7 |
Mimimum header length in bytes. More... | |
const int | MINI_HEADER_LENGTH = 3 |
mini header (in bytes): what you need to figure out the length of the rest of the packet. More... | |
const int | MAX_DATASIZE = (int)pow(2, 16) - MAX_HEADER_LENGTH |
Payload size of data packet in bytes. More... | |
const int | MAX_PACKET_LENGTH = MAX_HEADER_LENGTH + MAX_DATASIZE |
Max length of a packet in bytes. More... | |
const int | BROADCAST_LIFE = 30000 |
Live broadcasts are removed after (BROADCAST_LIFE * LIVE_BROADCAST_TABLE_SIZE) milliseconds have gone by. This is one tick of the live broadcast table. More... | |
const int | LIVE_BROADCAST_TABLE_SIZE = 10 |
Live Broadcast Table size. More... | |
const int | MAX_DISCOVERY_REQUESTS = 2 |
The maximum number of discovery requests a node can make to another node within (BROADCAST_LIFE * LIVE_BROADCAST_TABLE_SIZE) milliseconds. More... | |
const int | NP_HEADER_LENGTH = 7 |
Network Protocol header length in bytes. Data, Ping, Pong, Fin packets. More... | |
const int | CP_HEADER_LENGTH = NP_HEADER_LENGTH + 19 |
Connection packet minimum header size in bytes. More... | |
const int | IH_HEADER_LENGTH = NP_HEADER_LENGTH + 23 |
ImHere Packet size in bytes. More... | |
const int | DP_HEADER_LENGTH = NP_HEADER_LENGTH + 4 |
Discovery packet minimum size in bytes. More... | |
const int | FP_HEADER_LENGTH = NP_HEADER_LENGTH + 1 |
Fin Packet minimum size in bytes. More... | |
const double | DEFAULT_DISCOVERY_RESPONSE_PROBABILITY = 0.266 |
Percentage chance for this node to respond to a discovery request. This assumes Neighbor nodes == 10, we want to receive 2 responses, and we want to forward through 4 nodes. More... | |
const double | DEFAULT_DISCOVERY_PROPAGATION_PROBABILITY = 0.75 |
Percentage chance for this node to forward a discovery request. This assumes Neighbor nodes == 10, we want to receive 2 responses, and we want to forward through 4 nodes. More... | |
const double | DEFAULT_CONNECTION_PROPAGATION_PROBABILITY = 0.50 |
Percentage chance for this node to forward a connection packet. More... | |
const int | CONNECTION_TIMEOUT = 5000 |
Millisecs we will wait for an EST packet after we send a CONNECT packet, before we consider it a timeout. More... | |
const int | CONNECTION_MAX_TRIES = 1 |
Number of retrys to do before failing the connection. More... | |
const int | REPAIR_CONNECTION_TIMEOUT = 30000 |
Millisecs we will wait for an EST packet after we send a CONNECT packet, before we consider it a timeout. More... | |
const int | REPAIR_CONNECTION_MAX_RETRY = 0 |
number of retries before failing a reconnect. More... | |
const int | BROKEN_CONNECTION_TIMEOUT = 10000 |
millisecs we will wait before failing a broken connection. More... | |
const int | TP_HEADER_LENGTH = 3 |
Transport Protocol header length in bytes. More... | |
const int | SEGMENT_SIZE = 32768 - TP_HEADER_LENGTH - NP_HEADER_LENGTH |
The data that you want to send must be split into chucks. This is the size of those chunks, in bytes. Set the first number to be the total size you want each packet to be. More... | |
const int | WINDOW_SIZE = 16 |
sliding window size. More... | |
const int | SEND_PACKET_MAX_RETRY = 1 |
Number of times to try to resend a packet in the send window before failing - DO NOT set this to zero, otherwise the send window will always fail. More... | |
const int | MAX_SEND_WINDOW_TIMEOUTS = 3 |
Number of times the send window can be full before timing out and reporting an error. More... | |
const int | DEFAULT_RTT = 2000 |
Default round trip time. More... | |
const int | SEND_WINDOW_TIMEOUT = DEFAULT_RTT + 2000 |
Number of millisecs between each send window timeout. More... | |
const double | RETRANSMISSION_FACTOR = 1.5 |
Scales how quickly to time out a packet waiting for an ACK. This is multiplied by the RTT to get a number in millisecs. More... | |
const double | RTT_FACTOR = .9 |
how much the old rtt is valued. More... | |
const int | SEQ_NUM_SPACE = ((int)pow(2, 8)) |
the range of sequence numbers from zero to this number. The second number is the number of ACK bits. More... | |
const int | PROXY_PORT = 26689 |
Default proxy port number. More... | |
const int | HTTP_TEST_PROCESSOR_PORT = 8000 |
Default port for HTTP test command processor. More... | |
const int | MAX_PATH_LENGTH = 256 |
Maximum length of a path string to any file in the system in bytes. More... | |
const int | MAX_HOSTNAME_LENGTH = 256 |
Maximum length of a hostname string in bytes. More... | |
const int | MAX_LINE_LENGTH = 1024 |
Maximum length of one line of input from a stream in bytes. More... | |
const int | MAX_COMMAND_ARGS = 15 |
The max number of args a command can have. More... | |
const int | MAX_IP_ADDR_STR = 16 |
Max length of IP address string in bytes. More... | |
const int | MAX_INT_LENGTH = 11 |
Max string length of an integer, plus a NULL char in bytes. More... | |
const int | MAX_BOOL_LENGTH = 6 |
Max string length of a bool, plus a NULL char, in bytes. More... | |
const int | MAX_PORT_STR_LENGTH = 6 |
Max string length of a port number, plus the NULL char, in bytes. More... | |
const int | IP_PORT_FIELD_LENGTH = MAX_IP_ADDR_STR + MAX_PORT_STR_LENGTH + 2 |
Used for formatting fields in VirtualCircuitTable (+3 includes space for a colon). More... | |
const int | VCN_FIELD_LENGTH = MAX_INT_LENGTH + 2 |
Used for formatting fields in VirtualCircuitTable. More... |
|
Default certificate file name (for SSL).
Definition at line 56 of file GlobalConstants.h. |
|
Default server private key file.
Definition at line 59 of file GlobalConstants.h. |
|
Default private key password used to secure the client private key file.
Definition at line 62 of file GlobalConstants.h. |
|
Default configuration file name.
Definition at line 204 of file GlobalConstants.h. |
|
Default connection type.
Definition at line 24 of file GlobalConstants.h. |
|
Default file that contains the host list.
Definition at line 207 of file GlobalConstants.h. |
|
Default OpenSSL configuration file.
Definition at line 65 of file GlobalConstants.h. |
|
Default path to openssl files.
Definition at line 68 of file GlobalConstants.h. |
|
Default certificate file name (for SSL).
Definition at line 47 of file GlobalConstants.h. |
|
Default server private key file.
Definition at line 50 of file GlobalConstants.h. |
|
Default private key password used to secure the server private key file.
Definition at line 53 of file GlobalConstants.h. |
|
For configuration/synchronization files. This is what separates a variable name from its value.
Definition at line 211 of file GlobalConstants.h. |
|
The maximum size of a 4 byte signed integer.
Definition at line 263 of file GlobalConstants.h. |
|
Definition at line 14 of file GlobalConstants.h. |
|
Definition at line 13 of file GlobalConstants.h. |
|
Definition at line 12 of file GlobalConstants.h. |
|
Definition at line 16 of file GlobalConstants.h. |
|
Definition at line 11 of file GlobalConstants.h. |
|
Definition at line 17 of file GlobalConstants.h. |
|
Definition at line 15 of file GlobalConstants.h. |
|
Definition at line 6 of file GlobalConstants.h. |
|
The prompt for the command line.
Definition at line 231 of file GlobalConstants.h. |
|
Used by windows to identify the current socket version.
Definition at line 39 of file GlobalConstants.h. |
|
Size (in bytes) of an unsigned character.
Definition at line 267 of file GlobalConstants.h. |
|
Size (in bytes) of an unsigned int.
Definition at line 273 of file GlobalConstants.h. |
|
Size (in bytes) of an unsigned short.
Definition at line 270 of file GlobalConstants.h. |
|
Definition at line 276 of file GlobalConstants.h. |
|
Live broadcasts are removed after (BROADCAST_LIFE * LIVE_BROADCAST_TABLE_SIZE) milliseconds have gone by. This is one tick of the live broadcast table.
Definition at line 96 of file GlobalConstants.h. |
|
millisecs we will wait before failing a broken connection.
Definition at line 150 of file GlobalConstants.h. |
|
Number of retrys to do before failing the connection.
Definition at line 141 of file GlobalConstants.h. |
|
Millisecs we will wait for an EST packet after we send a CONNECT packet, before we consider it a timeout.
Definition at line 138 of file GlobalConstants.h. |
|
Connection packet minimum header size in bytes.
Definition at line 110 of file GlobalConstants.h. |
|
Percentage chance for this node to forward a connection packet.
Definition at line 130 of file GlobalConstants.h. |
|
Percentage chance for this node to forward a discovery request. This assumes Neighbor nodes == 10, we want to receive 2 responses, and we want to forward through 4 nodes.
Definition at line 127 of file GlobalConstants.h. |
|
Percentage chance for this node to respond to a discovery request. This assumes Neighbor nodes == 10, we want to receive 2 responses, and we want to forward through 4 nodes.
Definition at line 123 of file GlobalConstants.h. |
|
Default port number to listen on.
Definition at line 27 of file GlobalConstants.h. |
|
Default round trip time.
Definition at line 173 of file GlobalConstants.h. |
|
Discovery packet minimum size in bytes.
Definition at line 116 of file GlobalConstants.h. |
|
Fin Packet minimum size in bytes.
Definition at line 119 of file GlobalConstants.h. |
|
Default port for HTTP test command processor.
Definition at line 196 of file GlobalConstants.h. |
|
ImHere Packet size in bytes.
Definition at line 113 of file GlobalConstants.h. |
|
Used for formatting fields in VirtualCircuitTable (+3 includes space for a colon).
Definition at line 251 of file GlobalConstants.h. |
|
Live Broadcast Table size.
Definition at line 99 of file GlobalConstants.h. |
|
Max string length of a bool, plus a NULL char, in bytes.
Definition at line 245 of file GlobalConstants.h. |
|
The max number of args a command can have.
Definition at line 228 of file GlobalConstants.h. |
|
Max number of simultaneous connections.
Definition at line 30 of file GlobalConstants.h. |
|
Payload size of data packet in bytes.
Definition at line 88 of file GlobalConstants.h. |
|
The maximum number of discovery requests a node can make to another node within (BROADCAST_LIFE * LIVE_BROADCAST_TABLE_SIZE) milliseconds.
Definition at line 103 of file GlobalConstants.h. |
|
Maximum header length in bytes.
Definition at line 79 of file GlobalConstants.h. |
|
Maximum length of a hostname string in bytes.
Definition at line 217 of file GlobalConstants.h. |
|
Maximum length of host list.
Definition at line 36 of file GlobalConstants.h. |
|
Max string length of an integer, plus a NULL char in bytes.
Definition at line 242 of file GlobalConstants.h. |
|
Max length of IP address string in bytes.
Definition at line 239 of file GlobalConstants.h. |
|
Maximum length of one line of input from a stream in bytes.
Definition at line 220 of file GlobalConstants.h. |
|
Max length of a packet in bytes.
Definition at line 91 of file GlobalConstants.h. |
|
Maximum length of a path string to any file in the system in bytes.
Definition at line 214 of file GlobalConstants.h. |
|
Max string length of a port number, plus the NULL char, in bytes.
Definition at line 248 of file GlobalConstants.h. |
|
Number of times the send window can be full before timing out and reporting an error.
Definition at line 170 of file GlobalConstants.h. |
|
mini header (in bytes): what you need to figure out the length of the rest of the packet.
Definition at line 85 of file GlobalConstants.h. |
|
Minimum number of simultaneous connections.
Definition at line 33 of file GlobalConstants.h. |
|
Mimimum header length in bytes.
Definition at line 82 of file GlobalConstants.h. |
|
Network Protocol header length in bytes. Data, Ping, Pong, Fin packets.
Definition at line 107 of file GlobalConstants.h. |
|
Default proxy port number.
Definition at line 193 of file GlobalConstants.h. |
|
number of retries before failing a reconnect.
Definition at line 147 of file GlobalConstants.h. |
|
Millisecs we will wait for an EST packet after we send a CONNECT packet, before we consider it a timeout.
Definition at line 144 of file GlobalConstants.h. |
|
Scales how quickly to time out a packet waiting for an ACK. This is multiplied by the RTT to get a number in millisecs.
Definition at line 179 of file GlobalConstants.h. |
|
how much the old rtt is valued.
Definition at line 182 of file GlobalConstants.h. |
|
The data that you want to send must be split into chucks. This is the size of those chunks, in bytes. Set the first number to be the total size you want each packet to be.
Definition at line 160 of file GlobalConstants.h. |
|
Number of times to try to resend a packet in the send window before failing - DO NOT set this to zero, otherwise the send window will always fail.
Definition at line 167 of file GlobalConstants.h. |
|
Number of millisecs between each send window timeout.
Definition at line 176 of file GlobalConstants.h. |
|
the range of sequence numbers from zero to this number. The second number is the number of ACK bits.
Definition at line 185 of file GlobalConstants.h. |
|
Transport Protocol header length in bytes.
Definition at line 156 of file GlobalConstants.h. |
|
Used for formatting fields in VirtualCircuitTable.
Definition at line 254 of file GlobalConstants.h. |
|
Version number of the protocol (range 0-15).
Definition at line 76 of file GlobalConstants.h. |
|
sliding window size.
Definition at line 163 of file GlobalConstants.h. |