00001
00002
00003
00004
00005
00006
00007
00008 #ifndef CDSWL_H_
00009 #define CDSWL_H_
00010
00011 #include <packet.h>
00012
00013
00015 #define CDSWL_HELLO_MSG 1
00016
00017 #define CDSWL_NVEX_MSG 2
00018
00019 #define CDSWL_INITDECL_MSG 3
00020
00021 #define CDSWL_RESGDECL_MSG 4
00022
00023 #define CDSWL_DOMDECL_MSG 5
00024
00025
00026 #define CDSWL_MAX_NBRS 64
00027
00028 #define HDR_CDSWL_PKT(p) hdr_cdswl_pkt::access(p)
00029
00030 struct hdr_cdswl_pkt {
00031
00032 u_int8_t pkt_type_;
00033 u_int8_t pkt_subtype_;
00034 u_int16_t pkt_length_;
00035 nsaddr_t pkt_src_;
00036
00037 nsaddr_t *pkt_body_;
00038
00039
00040 inline u_int8_t& pkt_type() { return pkt_type_; }
00041 inline u_int8_t& pkt_subtype() { return pkt_subtype_ ; }
00042 inline u_int16_t& pkt_length() { return pkt_length_; }
00043 inline nsaddr_t& pkt_src() { return pkt_src_; }
00044
00045
00046
00047 static int offset_;
00048
00049
00050 inline static int& offset() { return offset_; }
00051 inline static hdr_cdswl_pkt* access(const Packet* p) {
00052 return (hdr_cdswl_pkt*) p->access(offset_);
00053 }
00054 };
00055
00056
00057 #endif