typedef struct vpn_packet_t {
length_t len; /* the actual number of bytes in the `data' field */
int priority; /* priority or TOS */
- node_id_t dstid; /* node ID of the final recipient */
- node_id_t srcid; /* node ID of the original sender */
- uint8_t seqno[4]; /* 32 bits sequence number (network byte order of course) */
+ uint32_t seqno; /* 32 bits sequence number (network byte order of course) */
uint8_t data[MAXSIZE];
} vpn_packet_t;
+typedef struct sptps_packet_t {
+ length_t len; /* the actual number of bytes in the `data' field */
+ int priority; /* priority or TOS */
+ node_id_t dstid; /* node ID of the final recipient */
+ node_id_t srcid; /* node ID of the original sender */
+ char data[MAXSIZE];
+} sptps_packet_t;
+
/* Packet types when using SPTPS */
#define PKT_COMPRESSED 1
extern void handle_new_unix_connection(void *, int);
extern int setup_listen_socket(const sockaddr_t *);
extern int setup_vpn_in_socket(const sockaddr_t *);
-extern bool send_sptps_data(void *handle, uint8_t type, const char *data, size_t len);
-extern bool receive_sptps_record(void *handle, uint8_t type, const char *data, uint16_t len);
+extern bool send_sptps_data(void *handle, uint8_t type, const void *data, size_t len);
+extern bool receive_sptps_record(void *handle, uint8_t type, const void *data, uint16_t len);
extern void send_packet(struct node_t *, vpn_packet_t *);
extern void receive_tcppacket(struct connection_t *, const char *, int);
extern void broadcast_packet(const struct node_t *, vpn_packet_t *);