-
Notifications
You must be signed in to change notification settings - Fork 82
/
lrhello.hh
62 lines (50 loc) · 1.52 KB
/
lrhello.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef LRHELLO_HH
#define LRHELLO_HH
/*
* =c
* SendGridLRHello(PERIOD, JITTER, ETH, IP, UpdateGridRoutes [, MAXHOPS])
* =s Grid
* =d
*
* Every PERIOD millseconds (+/- a jitter bounded by JITTER
* milliseconds), emit a Grid protocol ``LR_HELLO'' packet for the
* Grid node at address IP with MAC address ETH, advertising any
* neighbors within MAXHOPS of the node, as reported by the
* UpdateGridRoutes element named by the 5th argument. MAXHOPS
* defaults to 1. PERIOD must be greater than 0, JITTER must be
* positive and less than PERIOD. Produces Grid packets with MAC
* headers.
*
* =e
* SendGridLRHello(500, 100, 00:E0:98:09:27:C5, 18.26.4.115, nel) -> ? -> ToDevice(eth0)
*
* =a
* UpdateGridRoutes, LookupLocalGridRoute */
#include <click/element.hh>
#include <click/timer.hh>
#include <click/etheraddress.hh>
#include <click/ipaddress.hh>
#include "updateroutes.hh"
CLICK_DECLS
class SendGridLRHello : public Element {
public:
SendGridLRHello() CLICK_COLD;
~SendGridLRHello() CLICK_COLD;
const char *class_name() const override { return "SendGridLRHello"; }
const char *port_count() const override { return PORTS_0_1; }
const char *processing() const override { return PUSH; }
int configure(Vector<String> &, ErrorHandler *) CLICK_COLD;
int initialize(ErrorHandler *) CLICK_COLD;
Packet *make_hello();
void run_timer(Timer *);
private:
EtherAddress _from_eth;
IPAddress _from_ip;
int _period;
int _jitter;
Timer _timer;
UpdateGridRoutes *_nbr;
int _hops;
};
CLICK_ENDDECLS
#endif