diff options
-rw-r--r-- | mactelnet.c | 1 | ||||
-rw-r--r-- | protocol.c | 4 | ||||
-rw-r--r-- | protocol.h | 8 |
3 files changed, 5 insertions, 8 deletions
diff --git a/mactelnet.c b/mactelnet.c index b393eb1..236d5f9 100644 --- a/mactelnet.c +++ b/mactelnet.c @@ -110,6 +110,7 @@ static int send_udp(struct mt_packet *packet, int retransmit) { return sent_bytes; } + /* Retransmit */ send_udp(packet, 0); } @@ -28,10 +28,6 @@ #include "protocol.h" #include "config.h" -unsigned char mt_mactelnet_cpmagic[4] = { 0x56, 0x34, 0x12, 0xff }; -unsigned char mt_mactelnet_clienttype[2] = { 0x00, 0x15 }; -int retransmit_intervals[MAX_RETRANSMIT_INTERVALS] = { 15, 20, 30, 50, 90, 170, 330, 660, 1000 }; - int init_packet(struct mt_packet *packet, enum mt_ptype ptype, unsigned char *srcmac, unsigned char *dstmac, unsigned short sessionkey, unsigned int counter) { unsigned char *data = packet->data; @@ -92,13 +92,13 @@ extern int parse_control_packet(unsigned char *data, int data_len, struct mt_mac struct mt_mndp_packet *parse_mndp(const unsigned char *data, const int packet_len); int query_mndp(const char *identity, unsigned char *mac); -/* Initialized by protocol.c */ +/* Number of milliseconds between each retransmission */ #define MAX_RETRANSMIT_INTERVALS 9 -extern int retransmit_intervals[MAX_RETRANSMIT_INTERVALS]; +static const int retransmit_intervals[MAX_RETRANSMIT_INTERVALS] = { 15, 20, 30, 50, 90, 170, 330, 660, 1000 }; /* Control packet magic header */ -extern unsigned char mt_mactelnet_cpmagic[4]; -extern unsigned char mt_mactelnet_clienttype[2]; +static const unsigned char mt_mactelnet_cpmagic[4] = { 0x56, 0x34, 0x12, 0xff }; +static const unsigned char mt_mactelnet_clienttype[2] = { 0x00, 0x15 }; /* Must be initialized by application */ extern unsigned char mt_direction_fromserver; |