| 1 |
/********************************************************************* |
| 2 |
* |
| 3 |
* AUTHORIZATION TO USE AND DISTRIBUTE |
| 4 |
* |
| 5 |
* Redistribution and use in source and binary forms, with or without |
| 6 |
* modification, are permitted provided that: |
| 7 |
* |
| 8 |
* (1) source code distributions retain this paragraph in its entirety, |
| 9 |
* |
| 10 |
* (2) distributions including binary code include this paragraph in |
| 11 |
* its entirety in the documentation or other materials provided |
| 12 |
* with the distribution, and |
| 13 |
* |
| 14 |
* (3) all advertising materials mentioning features or use of this |
| 15 |
* software display the following acknowledgment: |
| 16 |
* |
| 17 |
* "This product includes software written and developed |
| 18 |
* by Brian Adamson, Joe Macker and Justin Dean of the |
| 19 |
* Naval Research Laboratory (NRL)." |
| 20 |
* |
| 21 |
* The name of NRL, the name(s) of NRL employee(s), or any entity |
| 22 |
* of the United States Government may not be used to endorse or |
| 23 |
* promote products derived from this software, nor does the |
| 24 |
* inclusion of the NRL written and developed software directly or |
| 25 |
* indirectly suggest NRL or United States Government endorsement |
| 26 |
* of this product. |
| 27 |
* |
| 28 |
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR |
| 29 |
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED |
| 30 |
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
| 31 |
********************************************************************/ |
| 32 |
|
| 33 |
#ifndef __ProtolibMK_packet_h__ |
| 34 |
#define __ProtolibMK_packet_h__ |
| 35 |
|
| 36 |
/* ===================================================================== |
| 37 |
Packet Formats... |
| 38 |
===================================================================== */ |
| 39 |
|
| 40 |
|
| 41 |
#define INVALID -1 |
| 42 |
/* |
| 43 |
* NROUTER Routing Protocol Header Macros |
| 44 |
*/ |
| 45 |
|
| 46 |
struct hdr_ProtolibMK { |
| 47 |
static int offset_; |
| 48 |
inline static int& offset() { return offset_; } |
| 49 |
inline static hdr_ProtolibMK* access(const Packet* p) { |
| 50 |
return (hdr_ProtolibMK*) p->access(offset_); |
| 51 |
} |
| 52 |
inline static hdr_ProtolibMK* access(const Packet* p,const int loffset) { |
| 53 |
return (hdr_ProtolibMK*) p->access(offset_+loffset); |
| 54 |
} |
| 55 |
}; |
| 56 |
|
| 57 |
#endif /* __ProtolibMK_packet_h__ */ |
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|