message.h 2.73 KB
Newer Older
Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
/*
Copyright (c) 2007 by Juliusz Chroboczek

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/

23 24 25
#define MAX_BUFFERED_UPDATES 200

extern unsigned short myseqno;
Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
26 27 28 29 30
extern int seqno_time;
extern int seqno_interval;

extern int parasitic;
extern int silent_time;
31
extern int broadcast_ihu;
Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
32 33 34
extern int split_horizon;

extern struct timeval update_flush_time;
35
extern const unsigned char packet_header[8];
Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
36

Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
37
unsigned short hash_id(const unsigned char *id) ATTRIBUTE ((pure));
Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
38 39 40
void parse_packet(const unsigned char *from, struct network *net,
                  const unsigned char *packet, int len);
void flushbuf(struct network *net);
41
void send_hello_noupdate(struct network *net, unsigned interval);
Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
42
void send_hello(struct network *net);
43
void send_request(struct network *net,
44 45 46
                  const unsigned char *prefix, unsigned char plen,
                  unsigned char hop_count, unsigned short seqno,
                  unsigned short router_hash);
47 48
void send_request_resend(const unsigned char *prefix, unsigned char plen,
                         unsigned short seqno, unsigned short router_hash);
49
void send_unicast_request(struct neighbour *neigh,
50 51 52
                          const unsigned char *prefix, unsigned char plen,
                          unsigned char hop_count, unsigned short seqno,
                          unsigned short router_hash);
53
void send_update(struct network *net, int urgent,
54
                 const unsigned char *prefix, unsigned char plen);
55
void update_myseqno(int force);
56
void send_self_update(struct network *net, int force_seqno);
Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
57 58
void send_self_retract(struct network *net);
void send_neighbour_update(struct neighbour *neigh, struct network *net);
59
void send_ihu(struct neighbour *neigh, struct network *net);
Juliusz Chroboczek's avatar
Juliusz Chroboczek committed
60 61 62 63 64 65 66 67 68 69 70 71
void schedule_flush_now(struct network *net);
void flushupdates(void);