-
Notifications
You must be signed in to change notification settings - Fork 0
/
hdr_rti.h
45 lines (36 loc) · 897 Bytes
/
hdr_rti.h
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
// Define the packet header for the pdns/rti information
// George F. Riley, Georgia Tech, Winter 2000
#ifndef __HDR_RTI_H__
#define __HDR_RTI_H__
#include "packet.h"
typedef unsigned int ipaddr_t;
typedef int ipportaddr_t;
struct hdr_rti {
ipaddr_t ipsrc_;
ipportaddr_t ipsrc_port_;
ipaddr_t ipdst_;
ipportaddr_t ipdst_port_;
unsigned long RTINodeId_; // Node id of originator
static int offset_;
inline static int& offset() { return offset_; }
inline static hdr_rti* access(Packet* p) {
return (hdr_rti*) p->access(offset_);
}
/* per-field member acces functions */
ipaddr_t& ipsrc() {
return ipsrc_;
}
ipportaddr_t& ipsrcport() {
return ipsrc_port_;
}
ipaddr_t& ipdst() {
return ipdst_;
}
ipportaddr_t& ipdstport() {
return ipdst_port_;
}
unsigned long& RTINodeId() {
return RTINodeId_;
}
};
#endif