/src/PcapPlusPlus/Packet++/header/PPPoELayer.h
Line | Count | Source (jump to first uncovered line) |
1 | | #ifndef PACKETPP_PPPOE_LAYER |
2 | | #define PACKETPP_PPPOE_LAYER |
3 | | |
4 | | #include "Layer.h" |
5 | | #include "TLVData.h" |
6 | | #include <vector> |
7 | | #include <string.h> |
8 | | |
9 | | /// @file |
10 | | |
11 | | /** |
12 | | * \namespace pcpp |
13 | | * \brief The main namespace for the PcapPlusPlus lib |
14 | | */ |
15 | | namespace pcpp |
16 | | { |
17 | | |
18 | | /** |
19 | | * @struct pppoe_header |
20 | | * Represents an PPPoE protocol header |
21 | | */ |
22 | | #pragma pack(push, 1) |
23 | | struct pppoe_header |
24 | | { |
25 | | #if (BYTE_ORDER == LITTLE_ENDIAN) |
26 | | /** PPPoE version */ |
27 | | uint8_t version:4, |
28 | | /** PPPoE type */ |
29 | | type:4; |
30 | | /** PPPoE code */ |
31 | | uint8_t code; |
32 | | #else |
33 | | /** PPPoE version */ |
34 | | uint16_t version:4, |
35 | | /** PPPoE type */ |
36 | | type:4, |
37 | | /** PPPoE code */ |
38 | | code:8; |
39 | | #endif |
40 | | /** PPPoE session ID (relevant for PPPoE session packets only) */ |
41 | | uint16_t sessionId; |
42 | | /** Length (in bytes) of payload, not including the PPPoE header */ |
43 | | uint16_t payloadLength; |
44 | | }; |
45 | | #pragma pack(pop) |
46 | | |
47 | | |
48 | | /** |
49 | | * @class PPPoELayer |
50 | | * An abstract class that describes the PPPoE protocol. Contains common data and logic of the two types of PPPoE packets: PPPoE session |
51 | | * and PPPoE discovery |
52 | | */ |
53 | | class PPPoELayer : public Layer |
54 | | { |
55 | | public: |
56 | | /** |
57 | | * PPPoE possible codes |
58 | | */ |
59 | | enum PPPoECode |
60 | | { |
61 | | /** PPPoE session code */ |
62 | | PPPOE_CODE_SESSION = 0x00, |
63 | | /** PPPoE discovery PADO */ |
64 | | PPPOE_CODE_PADO = 0x07, |
65 | | /** PPPoE discovery PADI */ |
66 | | PPPOE_CODE_PADI = 0x09, |
67 | | /** PPPoE discovery PADG */ |
68 | | PPPOE_CODE_PADG = 0x0a, |
69 | | /** PPPoE discovery PADC */ |
70 | | PPPOE_CODE_PADC = 0x0b, |
71 | | /** PPPoE discovery PADQ */ |
72 | | PPPOE_CODE_PADQ = 0x0c, |
73 | | /** PPPoE discovery PADR */ |
74 | | PPPOE_CODE_PADR = 0x19, |
75 | | /** PPPoE discovery PADS */ |
76 | | PPPOE_CODE_PADS = 0x65, |
77 | | /** PPPoE discovery PADT */ |
78 | | PPPOE_CODE_PADT = 0xa7, |
79 | | /** PPPoE discovery PADM */ |
80 | | PPPOE_CODE_PADM = 0xd3, |
81 | | /** PPPoE discovery PADN */ |
82 | | PPPOE_CODE_PADN = 0xd4 |
83 | | }; |
84 | | |
85 | 0 | ~PPPoELayer() {} |
86 | | |
87 | | /** |
88 | | * Get a pointer to the PPPoE header. Notice this points directly to the data, so every change will change the actual packet data |
89 | | * @return A pointer to the pppoe_header |
90 | | */ |
91 | 908 | pppoe_header* getPPPoEHeader() const { return (pppoe_header*)m_Data; } |
92 | | |
93 | | // abstract methods implementation |
94 | | |
95 | | /** |
96 | | * Calculate @ref pppoe_header#payloadLength field |
97 | | */ |
98 | | virtual void computeCalculateFields(); |
99 | | |
100 | 3.12k | OsiModelLayer getOsiModelLayer() const { return OsiModelDataLinkLayer; } |
101 | | |
102 | | protected: |
103 | | |
104 | | // protected c'tor as this class shouldn't be instantiated |
105 | 3.12k | PPPoELayer(uint8_t* data, size_t dataLen, Layer* prevLayer, Packet* packet) : Layer(data, dataLen, prevLayer, packet) { } |
106 | | |
107 | | // protected c'tor as this class shouldn't be instantiated |
108 | | PPPoELayer(uint8_t version, uint8_t type, PPPoELayer::PPPoECode code, uint16_t sessionId, size_t additionalBytesToAllocate = 0); |
109 | | |
110 | | }; |
111 | | |
112 | | |
113 | | /** |
114 | | * @class PPPoESessionLayer |
115 | | * Describes the PPPoE session protocol |
116 | | */ |
117 | | class PPPoESessionLayer : public PPPoELayer |
118 | | { |
119 | | public: |
120 | | |
121 | | /** |
122 | | * A constructor that creates the layer from an existing packet raw data |
123 | | * @param[in] data A pointer to the raw data (will be casted to @ref pppoe_header) |
124 | | * @param[in] dataLen Size of the data in bytes |
125 | | * @param[in] prevLayer A pointer to the previous layer |
126 | | * @param[in] packet A pointer to the Packet instance where layer will be stored in |
127 | | */ |
128 | 2.21k | PPPoESessionLayer(uint8_t* data, size_t dataLen, Layer* prevLayer, Packet* packet) : PPPoELayer(data, dataLen, prevLayer, packet) { m_Protocol = PPPoESession; } |
129 | | |
130 | | /** |
131 | | * A constructor that allocates a new PPPoE Session header with version, type and session ID |
132 | | * @param[in] version PPPoE version |
133 | | * @param[in] type PPPoE type |
134 | | * @param[in] sessionId PPPoE session ID |
135 | | * @param[in] pppNextProtocol The next protocol to come after the PPPoE session header. Should be one of the PPP_* macros listed below |
136 | | */ |
137 | 0 | PPPoESessionLayer(uint8_t version, uint8_t type, uint16_t sessionId, uint16_t pppNextProtocol) : PPPoELayer(version, type, PPPoELayer::PPPOE_CODE_SESSION, sessionId, sizeof(uint16_t)) { setPPPNextProtocol(pppNextProtocol); } |
138 | | |
139 | 0 | virtual ~PPPoESessionLayer() {} |
140 | | |
141 | | /** |
142 | | * @return The protocol after the PPPoE session header. The return value is one of the PPP_* macros listed below. This method is also |
143 | | * used when parsing a packet (this way we know which layer comes after the PPPoE session) |
144 | | */ |
145 | | uint16_t getPPPNextProtocol() const; |
146 | | |
147 | | /** |
148 | | * Set the field that describes which header comes after the PPPoE session header |
149 | | * @param[in] nextProtocol The protocol value. Should be one of the PPP_* macros listed below |
150 | | */ |
151 | | void setPPPNextProtocol(uint16_t nextProtocol); |
152 | | |
153 | | /** |
154 | | * A static method that validates the input data |
155 | | * @param[in] data The pointer to the beginning of byte stream of a packet |
156 | | * @param[in] dataLen The length of the byte stream |
157 | | * @return True if the data is valid and can represent a PPPoES packet |
158 | | */ |
159 | | static inline bool isDataValid(const uint8_t* data, size_t dataLen); |
160 | | |
161 | | // abstract methods implementation |
162 | | |
163 | | /** |
164 | | * Currently identifies the following next layers: IPv4Layer, IPv6Layer. Otherwise sets PayloadLayer |
165 | | */ |
166 | | virtual void parseNextLayer(); |
167 | | |
168 | | /** |
169 | | * @return Size of @ref pppoe_header |
170 | | */ |
171 | 3.82k | virtual size_t getHeaderLen() const { return sizeof(pppoe_header) + sizeof(uint16_t); } |
172 | | |
173 | | virtual std::string toString() const; |
174 | | }; |
175 | | |
176 | | |
177 | | |
178 | | /** |
179 | | * @class PPPoEDiscoveryLayer |
180 | | * Describes the PPPoE discovery protocol |
181 | | */ |
182 | | class PPPoEDiscoveryLayer : public PPPoELayer |
183 | | { |
184 | | public: |
185 | | /** |
186 | | * PPPoE tag types |
187 | | */ |
188 | | enum PPPoETagTypes |
189 | | { |
190 | | /** End-Of-List tag type*/ |
191 | | PPPOE_TAG_EOL = 0x0000, |
192 | | /** Service-Name tag type*/ |
193 | | PPPOE_TAG_SVC_NAME = 0x0101, |
194 | | /** AC-Name tag type*/ |
195 | | PPPOE_TAG_AC_NAME = 0x0102, |
196 | | /** Host-Uniq tag type*/ |
197 | | PPPOE_TAG_HOST_UNIQ = 0x0103, |
198 | | /** AC-Cookie tag type*/ |
199 | | PPPOE_TAG_AC_COOKIE = 0x0104, |
200 | | /** Vendor-Specific tag type*/ |
201 | | PPPOE_TAG_VENDOR = 0x0105, |
202 | | /** Credits tag type*/ |
203 | | PPPOE_TAG_CREDITS = 0x0106, |
204 | | /** Metrics tag type*/ |
205 | | PPPOE_TAG_METRICS = 0x0107, |
206 | | /** Sequence Number tag type */ |
207 | | PPPOE_TAG_SEQ_NUM = 0x0108, |
208 | | /** Credit Scale Factor tag type */ |
209 | | PPPOE_TAG_CRED_SCALE = 0x0109, |
210 | | /** Relay-Session-Id tag type */ |
211 | | PPPOE_TAG_RELAY_ID = 0x0110, |
212 | | /** HURL tag type */ |
213 | | PPPOE_TAG_HURL = 0x0111, |
214 | | /** MOTM tag type */ |
215 | | PPPOE_TAG_MOTM = 0x0112, |
216 | | /** PPP-Max-Payload tag type */ |
217 | | PPPOE_TAG_MAX_PAYLD = 0x0120, |
218 | | /** IP_Route_Add tag type */ |
219 | | PPPOE_TAG_IP_RT_ADD = 0x0121, |
220 | | /** Service-Name-Error tag type */ |
221 | | PPPOE_TAG_SVC_ERR = 0x0201, |
222 | | /** AC-System-Error tag type */ |
223 | | PPPOE_TAG_AC_ERR = 0x0202, |
224 | | /** Generic-Error tag type */ |
225 | | PPPOE_TAG_GENERIC_ERR= 0x0203 |
226 | | }; |
227 | | |
228 | | /** |
229 | | * @class PPPoETag |
230 | | * Represents a PPPoE tag and its data |
231 | | */ |
232 | | class PPPoETag : public TLVRecord<uint16_t, uint16_t> |
233 | | { |
234 | | public: |
235 | | /** |
236 | | * A c'tor that gets a pointer to the tag raw data (byte array) |
237 | | * @param[in] tagRawData A pointer to the tag raw data |
238 | | */ |
239 | 0 | explicit PPPoETag(uint8_t* tagRawData) : TLVRecord(tagRawData) { } |
240 | | |
241 | | /** |
242 | | * A d'tor for this class, currently does nothing |
243 | | */ |
244 | 0 | virtual ~PPPoETag() { } |
245 | | |
246 | | /** |
247 | | * @return The tag type converted to PPPoEDiscoveryLayer#PPPoETagTypes enum |
248 | | */ |
249 | | PPPoEDiscoveryLayer::PPPoETagTypes getType() const; |
250 | | |
251 | | /** |
252 | | * Retrieve the tag data as string. Relevant only if the tag value is indeed a string |
253 | | * @return The tag data as string |
254 | | */ |
255 | | std::string getValueAsString() const |
256 | 0 | { |
257 | 0 | size_t dataSize = getDataSize(); |
258 | 0 | if (dataSize < 1) |
259 | 0 | return ""; |
260 | 0 |
|
261 | 0 | return std::string((const char*)m_Data->recordValue, dataSize); |
262 | 0 | } |
263 | | |
264 | | // implement abstract methods |
265 | | |
266 | | size_t getTotalSize() const; |
267 | | |
268 | | size_t getDataSize() const; |
269 | | }; |
270 | | |
271 | | |
272 | | /** |
273 | | * @class PPPoETagBuilder |
274 | | * A class for building PPPoE Tags. This builder receives the tag parameters in its c'tor, |
275 | | * builds the PPPoE Tag raw buffer and provides a build() method to get a PPPoETag object out of it |
276 | | */ |
277 | | class PPPoETagBuilder : public TLVRecordBuilder |
278 | | { |
279 | | public: |
280 | | |
281 | | /** |
282 | | * A c'tor for building a PPPoE Tag which has no value (tag len is zero). The PPPoETag object can later |
283 | | * be retrieved by calling build() |
284 | | * @param[in] tagType Tag type |
285 | | */ |
286 | | explicit PPPoETagBuilder(PPPoETagTypes tagType) : |
287 | 0 | TLVRecordBuilder(static_cast<uint16_t>(tagType), NULL, 0) { } |
288 | | |
289 | | /** |
290 | | * A c'tor for building a PPPoE Tag which has a 4-byte value. The PPPoETag object can later |
291 | | * be retrieved by calling build() |
292 | | * @param[in] tagType Tag type |
293 | | * @param[in] tagValue The tag's 4-byte value |
294 | | */ |
295 | | PPPoETagBuilder(PPPoETagTypes tagType, uint32_t tagValue) : |
296 | 0 | TLVRecordBuilder(static_cast<uint16_t>(tagType), tagValue) { } |
297 | | |
298 | | /** |
299 | | * A c'tor for building a PPPoE Tag which has some arbitrary value. The PPPoETag object can later |
300 | | * be retrieved by calling build() |
301 | | * @param[in] tagType Tag type |
302 | | * @param[in] tagValue A byte array that contains the tag data |
303 | | * @param[in] tagValueLen The length of the value byte array |
304 | | */ |
305 | | PPPoETagBuilder(PPPoETagTypes tagType, uint8_t* tagValue, uint8_t tagValueLen) : |
306 | 0 | TLVRecordBuilder(static_cast<uint16_t>(tagType), tagValue, tagValueLen) { } |
307 | | |
308 | | /** |
309 | | * Build the PPPoETag object out of the parameters defined in the c'tor |
310 | | * @return The PPPoETag object |
311 | | */ |
312 | | PPPoETag build() const; |
313 | | }; |
314 | | |
315 | | /** |
316 | | * A constructor that creates the layer from an existing packet raw data |
317 | | * @param[in] data A pointer to the raw data (will be casted to @ref pppoe_header) |
318 | | * @param[in] dataLen Size of the data in bytes |
319 | | * @param[in] prevLayer A pointer to the previous layer |
320 | | * @param[in] packet A pointer to the Packet instance where layer will be stored in |
321 | | */ |
322 | 908 | PPPoEDiscoveryLayer(uint8_t* data, size_t dataLen, Layer* prevLayer, Packet* packet) : PPPoELayer(data, dataLen, prevLayer, packet) { m_Protocol = PPPoEDiscovery; m_DataLen = getHeaderLen(); } |
323 | | |
324 | | /** |
325 | | * A constructor that allocates a new PPPoE Discovery header with version, type, PPPoE code and session ID |
326 | | * @param[in] version PPPoE version |
327 | | * @param[in] type PPPoE type |
328 | | * @param[in] code PPPoE code enum |
329 | | * @param[in] sessionId PPPoE session ID |
330 | | */ |
331 | 0 | PPPoEDiscoveryLayer(uint8_t version, uint8_t type, PPPoELayer::PPPoECode code, uint16_t sessionId) : PPPoELayer(version, type, code, sessionId) { m_Protocol = PPPoEDiscovery; } |
332 | | |
333 | | /** |
334 | | * Get a PPPoE Tag by tag type. |
335 | | * @param[in] tagType The type of the tag to search |
336 | | * @return A PPPoETag object that contains the first tag that matches this type, or logical NULL |
337 | | * (PPPoETag#isNull() == true) if no such tag found |
338 | | */ |
339 | | PPPoETag getTag(PPPoEDiscoveryLayer::PPPoETagTypes tagType) const; |
340 | | |
341 | | /** |
342 | | * @return The first tag in the PPPoE discovery layer. If the current layer contains no tags the returned value will contain |
343 | | * a logical NULL (PPPoETag#isNull() == true) |
344 | | */ |
345 | | PPPoETag getFirstTag() const; |
346 | | |
347 | | /** |
348 | | * Get the tag that comes right after the "tag" parameter. If the given tag is the last one, the returned value |
349 | | * will contain a logical NULL (PPPoETag#isNull() == true) |
350 | | * @param[in] tag A given tag |
351 | | * @return A PPPoETag object containing the tag that comes next, or logical NULL if the given |
352 | | * tag: (1) was the last one; (2) contains a logical NULL or (3) doesn't belong to this packet |
353 | | */ |
354 | | PPPoETag getNextTag(const PPPoETag& tag) const; |
355 | | |
356 | | /** |
357 | | * @return The number of tags in this layer |
358 | | */ |
359 | | int getTagCount() const; |
360 | | |
361 | | /** |
362 | | * Add a new PPPoE Tag at the end of the layer |
363 | | * @param[in] tagBuilder A PPPoETagBuilder object that contains the requested tag data to add |
364 | | * @return A PPPoETag object containing the newly added PPPoE Tag data or logical NULL |
365 | | * (PPPoETag#isNull() == true) if addition failed |
366 | | */ |
367 | | PPPoETag addTag(const PPPoETagBuilder& tagBuilder); |
368 | | |
369 | | /** |
370 | | * Add a new PPPoE Tag after an existing one |
371 | | * @param[in] tagBuilder A PPPoETagBuilder object that contains the requested tag data to add |
372 | | * @param[in] prevTagType The PPPoE Tag which the newly added tag will come after |
373 | | * @return A PPPoETag object containing the newly added PPPoE Tag data or logical NULL |
374 | | * (PPPoETag#isNull() == true) if addition failed |
375 | | */ |
376 | | PPPoETag addTagAfter(const PPPoETagBuilder& tagBuilder, PPPoETagTypes prevTagType); |
377 | | |
378 | | /** |
379 | | * Remove an existing tag. Tag will be found by the tag type |
380 | | * @param[in] tagType The tag type to remove |
381 | | * @return True if tag was removed or false if tag wasn't found or if tag removal failed (in each case a proper error will be written |
382 | | * to log) |
383 | | */ |
384 | | bool removeTag(PPPoEDiscoveryLayer::PPPoETagTypes tagType); |
385 | | |
386 | | /** |
387 | | * Remove all tags in this layer |
388 | | * @return True if all tags were successfully or false if removal failed for some reason (a proper error will be written to log) |
389 | | */ |
390 | | bool removeAllTags(); |
391 | | |
392 | | /** |
393 | | * A static method that validates the input data |
394 | | * @param[in] data The pointer to the beginning of byte stream of a packet |
395 | | * @param[in] dataLen The length of the byte stream |
396 | | * @return True if the data is valid and can represent a PPPoED packet |
397 | | */ |
398 | | static inline bool isDataValid(const uint8_t* data, size_t dataLen); |
399 | | |
400 | | // abstract methods implementation |
401 | | |
402 | | /** |
403 | | * Does nothing for this layer (PPPoE discovery is always the last layer) |
404 | | */ |
405 | 908 | virtual void parseNextLayer() {} |
406 | | |
407 | | /** |
408 | | * @return The header length which is size of strcut pppoe_header plus the total size of tags |
409 | | */ |
410 | | virtual size_t getHeaderLen() const; |
411 | | |
412 | 0 | virtual std::string toString() const { return "PPP-over-Ethernet Discovery (" + codeToString((PPPoELayer::PPPoECode)getPPPoEHeader()->code) + ")"; } |
413 | | |
414 | | private: |
415 | | TLVRecordReader<PPPoETag> m_TagReader; |
416 | | |
417 | | PPPoETag addTagAt(const PPPoETagBuilder& tagBuilder, int offset); |
418 | | |
419 | 0 | uint8_t* getTagBasePtr() const { return m_Data + sizeof(pppoe_header); } |
420 | | |
421 | | std::string codeToString(PPPoECode code) const; |
422 | | }; |
423 | | |
424 | | |
425 | | // implementation of inline methods |
426 | | |
427 | | bool PPPoESessionLayer::isDataValid(const uint8_t* data, size_t dataLen) |
428 | 2.84k | { |
429 | 2.84k | return dataLen >= sizeof(pppoe_header) + sizeof(uint16_t); |
430 | 2.84k | } |
431 | | |
432 | | bool PPPoEDiscoveryLayer::isDataValid(const uint8_t* data, size_t dataLen) |
433 | 1.29k | { |
434 | 1.29k | return dataLen >= sizeof(pppoe_header); |
435 | 1.29k | } |
436 | | |
437 | | // Copied from Wireshark: ppptypes.h |
438 | | |
439 | | /** Padding Protocol */ |
440 | 2 | #define PCPP_PPP_PADDING 0x1 |
441 | | /** ROHC small-CID */ |
442 | 2 | #define PCPP_PPP_ROHC_SCID 0x3 |
443 | | /** ROHC large-CID */ |
444 | 2 | #define PCPP_PPP_ROHC_LCID 0x5 |
445 | | /** Internet Protocol version 4 */ |
446 | 2.07k | #define PCPP_PPP_IP 0x21 |
447 | | /** OSI Network Layer */ |
448 | 2 | #define PCPP_PPP_OSI 0x23 |
449 | | /** Xerox NS IDP */ |
450 | 2 | #define PCPP_PPP_XNSIDP 0x25 |
451 | | /** DECnet Phase IV */ |
452 | 2 | #define PCPP_PPP_DEC4 0x27 |
453 | | /** AppleTalk */ |
454 | 2 | #define PCPP_PPP_AT 0x29 |
455 | | /** Novell IPX */ |
456 | 2 | #define PCPP_PPP_IPX 0x2b |
457 | | /** Van Jacobson Compressed TCP/IP */ |
458 | 2 | #define PCPP_PPP_VJC_COMP 0x2d |
459 | | /** Van Jacobson Uncompressed TCP/IP */ |
460 | 2 | #define PCPP_PPP_VJC_UNCOMP 0x2f |
461 | | /** Bridging PDU */ |
462 | 2 | #define PCPP_PPP_BCP 0x31 |
463 | | /** Stream Protocol (ST-II) */ |
464 | 2 | #define PCPP_PPP_ST 0x33 |
465 | | /** Banyan Vines */ |
466 | 2 | #define PCPP_PPP_VINES 0x35 |
467 | | /** AppleTalk EDDP */ |
468 | 2 | #define PCPP_PPP_AT_EDDP 0x39 |
469 | | /** AppleTalk SmartBuffered */ |
470 | 2 | #define PCPP_PPP_AT_SB 0x3b |
471 | | /** Multi-Link */ |
472 | 2 | #define PCPP_PPP_MP 0x3d |
473 | | /** NETBIOS Framing */ |
474 | 2 | #define PCPP_PPP_NB 0x3f |
475 | | /** Cisco Systems */ |
476 | 2 | #define PCPP_PPP_CISCO 0x41 |
477 | | /** Ascom Timeplex */ |
478 | 2 | #define PCPP_PPP_ASCOM 0x43 |
479 | | /** Fujitsu Link Backup and Load Balancing */ |
480 | 2 | #define PCPP_PPP_LBLB 0x45 |
481 | | /** DCA Remote Lan */ |
482 | 2 | #define PCPP_PPP_RL 0x47 |
483 | | /** Serial Data Transport Protocol */ |
484 | 2 | #define PCPP_PPP_SDTP 0x49 |
485 | | /** SNA over 802.2 */ |
486 | 2 | #define PCPP_PPP_LLC 0x4b |
487 | | /** SNA */ |
488 | 2 | #define PCPP_PPP_SNA 0x4d |
489 | | /** IPv6 Header Compression */ |
490 | 2 | #define PCPP_PPP_IPV6HC 0x4f |
491 | | /** KNX Bridging Data */ |
492 | 2 | #define PCPP_PPP_KNX 0x51 |
493 | | /** Encryption */ |
494 | 2 | #define PCPP_PPP_ENCRYPT 0x53 |
495 | | /** Individual Link Encryption */ |
496 | 2 | #define PCPP_PPP_ILE 0x55 |
497 | | /** Internet Protocol version 6 */ |
498 | 1.09k | #define PCPP_PPP_IPV6 0x57 |
499 | | /** PPP Muxing */ |
500 | 2 | #define PCPP_PPP_MUX 0x59 |
501 | | /** Vendor-Specific Network Protocol (VSNP) */ |
502 | 2 | #define PCPP_PPP_VSNP 0x5b |
503 | | /** TRILL Network Protocol (TNP) */ |
504 | 2 | #define PCPP_PPP_TNP 0x5d |
505 | | /** RTP IPHC Full Header */ |
506 | 2 | #define PCPP_PPP_RTP_FH 0x61 |
507 | | /** RTP IPHC Compressed TCP */ |
508 | 2 | #define PCPP_PPP_RTP_CTCP 0x63 |
509 | | /** RTP IPHC Compressed Non TCP */ |
510 | 2 | #define PCPP_PPP_RTP_CNTCP 0x65 |
511 | | /** RTP IPHC Compressed UDP 8 */ |
512 | 2 | #define PCPP_PPP_RTP_CUDP8 0x67 |
513 | | /** RTP IPHC Compressed RTP 8 */ |
514 | 2 | #define PCPP_PPP_RTP_CRTP8 0x69 |
515 | | /** Stampede Bridging */ |
516 | 2 | #define PCPP_PPP_STAMPEDE 0x6f |
517 | | /** MP+ Protocol */ |
518 | 2 | #define PCPP_PPP_MPPLUS 0x73 |
519 | | /** NTCITS IPI */ |
520 | 2 | #define PCPP_PPP_NTCITS_IPI 0xc1 |
521 | | /** Single link compression in multilink */ |
522 | 2 | #define PCPP_PPP_ML_SLCOMP 0xfb |
523 | | /** Compressed datagram */ |
524 | 2 | #define PCPP_PPP_COMP 0xfd |
525 | | /** 802.1d Hello Packets */ |
526 | 2 | #define PCPP_PPP_STP_HELLO 0x0201 |
527 | | /** IBM Source Routing BPDU */ |
528 | 2 | #define PCPP_PPP_IBM_SR 0x0203 |
529 | | /** DEC LANBridge100 Spanning Tree */ |
530 | 2 | #define PCPP_PPP_DEC_LB 0x0205 |
531 | | /** Cisco Discovery Protocol */ |
532 | 2 | #define PCPP_PPP_CDP 0x0207 |
533 | | /** Netcs Twin Routing */ |
534 | 2 | #define PCPP_PPP_NETCS 0x0209 |
535 | | /** STP - Scheduled Transfer Protocol */ |
536 | 2 | #define PCPP_PPP_STP 0x020b |
537 | | /** EDP - Extreme Discovery Protocol */ |
538 | 2 | #define PCPP_PPP_EDP 0x020d |
539 | | /** Optical Supervisory Channel Protocol */ |
540 | 2 | #define PCPP_PPP_OSCP 0x0211 |
541 | | /** Optical Supervisory Channel Protocol */ |
542 | 2 | #define PCPP_PPP_OSCP2 0x0213 |
543 | | /** Luxcom */ |
544 | 2 | #define PCPP_PPP_LUXCOM 0x0231 |
545 | | /** Sigma Network Systems */ |
546 | 2 | #define PCPP_PPP_SIGMA 0x0233 |
547 | | /** Apple Client Server Protocol */ |
548 | 2 | #define PCPP_PPP_ACSP 0x0235 |
549 | | /** MPLS Unicast */ |
550 | 2 | #define PCPP_PPP_MPLS_UNI 0x0281 |
551 | | /** MPLS Multicast */ |
552 | 2 | #define PCPP_PPP_MPLS_MULTI 0x0283 |
553 | | /** IEEE p1284.4 standard - data packets */ |
554 | 2 | #define PCPP_PPP_P12844 0x0285 |
555 | | /** ETSI TETRA Network Protocol Type 1 */ |
556 | 2 | #define PCPP_PPP_TETRA 0x0287 |
557 | | /** Multichannel Flow Treatment Protocol */ |
558 | 2 | #define PCPP_PPP_MFTP 0x0289 |
559 | | /** RTP IPHC Compressed TCP No Delta */ |
560 | 2 | #define PCPP_PPP_RTP_CTCPND 0x2063 |
561 | | /** RTP IPHC Context State */ |
562 | 2 | #define PCPP_PPP_RTP_CS 0x2065 |
563 | | /** RTP IPHC Compressed UDP 16 */ |
564 | 2 | #define PCPP_PPP_RTP_CUDP16 0x2067 |
565 | | /** RTP IPHC Compressed RTP 16 */ |
566 | 2 | #define PCPP_PPP_RTP_CRDP16 0x2069 |
567 | | /** Cray Communications Control Protocol */ |
568 | 2 | #define PCPP_PPP_CCCP 0x4001 |
569 | | /** CDPD Mobile Network Registration Protocol */ |
570 | 2 | #define PCPP_PPP_CDPD_MNRP 0x4003 |
571 | | /** Expand accelerator protocol */ |
572 | 2 | #define PCPP_PPP_EXPANDAP 0x4005 |
573 | | /** ODSICP NCP */ |
574 | 2 | #define PCPP_PPP_ODSICP 0x4007 |
575 | | /** DOCSIS DLL */ |
576 | 2 | #define PCPP_PPP_DOCSIS 0x4009 |
577 | | /** Cetacean Network Detection Protocol */ |
578 | 2 | #define PCPP_PPP_CETACEANNDP 0x400b |
579 | | /** Stacker LZS */ |
580 | 2 | #define PCPP_PPP_LZS 0x4021 |
581 | | /** RefTek Protocol */ |
582 | 2 | #define PCPP_PPP_REFTEK 0x4023 |
583 | | /** Fibre Channel */ |
584 | 2 | #define PCPP_PPP_FC 0x4025 |
585 | | /** EMIT Protocols */ |
586 | 2 | #define PCPP_PPP_EMIT 0x4027 |
587 | | /** Vendor-Specific Protocol (VSP) */ |
588 | 2 | #define PCPP_PPP_VSP 0x405b |
589 | | /** TRILL Link State Protocol (TLSP) */ |
590 | 2 | #define PCPP_PPP_TLSP 0x405d |
591 | | /** Internet Protocol Control Protocol */ |
592 | 2 | #define PCPP_PPP_IPCP 0x8021 |
593 | | /** OSI Network Layer Control Protocol */ |
594 | 2 | #define PCPP_PPP_OSINLCP 0x8023 |
595 | | /** Xerox NS IDP Control Protocol */ |
596 | 2 | #define PCPP_PPP_XNSIDPCP 0x8025 |
597 | | /** DECnet Phase IV Control Protocol */ |
598 | 2 | #define PCPP_PPP_DECNETCP 0x8027 |
599 | | /** AppleTalk Control Protocol */ |
600 | 2 | #define PCPP_PPP_ATCP 0x8029 |
601 | | /** Novell IPX Control Protocol */ |
602 | 2 | #define PCPP_PPP_IPXCP 0x802b |
603 | | /** Bridging NCP */ |
604 | 2 | #define PCPP_PPP_BRIDGENCP 0x8031 |
605 | | /** Stream Protocol Control Protocol */ |
606 | 2 | #define PCPP_PPP_SPCP 0x8033 |
607 | | /** Banyan Vines Control Protocol */ |
608 | 2 | #define PCPP_PPP_BVCP 0x8035 |
609 | | /** Multi-Link Control Protocol */ |
610 | 2 | #define PCPP_PPP_MLCP 0x803d |
611 | | /** NETBIOS Framing Control Protocol */ |
612 | 2 | #define PCPP_PPP_NBCP 0x803f |
613 | | /** Cisco Systems Control Protocol */ |
614 | 2 | #define PCPP_PPP_CISCOCP 0x8041 |
615 | | /** Ascom Timeplex Control Protocol (?) */ |
616 | 2 | #define PCPP_PPP_ASCOMCP 0x8043 |
617 | | /** Fujitsu LBLB Control Protocol */ |
618 | 2 | #define PCPP_PPP_LBLBCP 0x8045 |
619 | | /** DCA Remote Lan Network Control Protocol */ |
620 | 2 | #define PCPP_PPP_RLNCP 0x8047 |
621 | | /** Serial Data Control Protocol */ |
622 | 2 | #define PCPP_PPP_SDCP 0x8049 |
623 | | /** SNA over 802.2 Control Protocol */ |
624 | 2 | #define PCPP_PPP_LLCCP 0x804b |
625 | | /** SNA Control Protocol */ |
626 | 2 | #define PCPP_PPP_SNACP 0x804d |
627 | | /** IP6 Header Compression Control Protocol */ |
628 | 2 | #define PCPP_PPP_IP6HCCP 0x804f |
629 | | /** KNX Bridging Control Protocol */ |
630 | 2 | #define PCPP_PPP_KNXCP 0x8051 |
631 | | /** Encryption Control Protocol */ |
632 | 2 | #define PCPP_PPP_ECP 0x8053 |
633 | | /** Individual Link Encryption Control Protocol */ |
634 | 2 | #define PCPP_PPP_ILECP 0x8055 |
635 | | /** IPv6 Control Protocol */ |
636 | 2 | #define PCPP_PPP_IPV6CP 0x8057 |
637 | | /** PPP Muxing Control Protocol */ |
638 | 2 | #define PCPP_PPP_MUXCP 0x8059 |
639 | | /** Vendor-Specific Network Control Protocol (VSNCP) [RFC3772] */ |
640 | 2 | #define PCPP_PPP_VSNCP 0x805b |
641 | | /** TRILL Network Control Protocol (TNCP) */ |
642 | 2 | #define PCPP_PPP_TNCP 0x805d |
643 | | /** Stampede Bridging Control Protocol */ |
644 | 2 | #define PCPP_PPP_STAMPEDECP 0x806f |
645 | | /** MP+ Contorol Protocol */ |
646 | 2 | #define PCPP_PPP_MPPCP 0x8073 |
647 | | /** NTCITS IPI Control Protocol */ |
648 | 2 | #define PCPP_PPP_IPICP 0x80c1 |
649 | | /** Single link compression in multilink control */ |
650 | 2 | #define PCPP_PPP_SLCC 0x80fb |
651 | | /** Compression Control Protocol */ |
652 | 2 | #define PCPP_PPP_CCP 0x80fd |
653 | | /** Cisco Discovery Protocol Control Protocol */ |
654 | 2 | #define PCPP_PPP_CDPCP 0x8207 |
655 | | /** Netcs Twin Routing */ |
656 | 2 | #define PCPP_PPP_NETCSCP 0x8209 |
657 | | /** STP - Control Protocol */ |
658 | 2 | #define PCPP_PPP_STPCP 0x820b |
659 | | /** EDPCP - Extreme Discovery Protocol Control Protocol */ |
660 | 2 | #define PCPP_PPP_EDPCP 0x820d |
661 | | /** Apple Client Server Protocol Control */ |
662 | 2 | #define PCPP_PPP_ACSPC 0x8235 |
663 | | /** MPLS Control Protocol */ |
664 | 2 | #define PCPP_PPP_MPLSCP 0x8281 |
665 | | /** IEEE p1284.4 standard - Protocol Control */ |
666 | 2 | #define PCPP_PPP_P12844CP 0x8285 |
667 | | /** ETSI TETRA TNP1 Control Protocol */ |
668 | 2 | #define PCPP_PPP_TETRACP 0x8287 |
669 | | /** Multichannel Flow Treatment Protocol */ |
670 | 2 | #define PCPP_PPP_MFTPCP 0x8289 |
671 | | /** Link Control Protocol */ |
672 | 2 | #define PCPP_PPP_LCP 0xc021 |
673 | | /** Password Authentication Protocol */ |
674 | 2 | #define PCPP_PPP_PAP 0xc023 |
675 | | /** Link Quality Report */ |
676 | 2 | #define PCPP_PPP_LQR 0xc025 |
677 | | /** Shiva Password Authentication Protocol */ |
678 | 2 | #define PCPP_PPP_SPAP 0xc027 |
679 | | /** CallBack Control Protocol (CBCP) */ |
680 | 2 | #define PCPP_PPP_CBCP 0xc029 |
681 | | /** BACP Bandwidth Allocation Control Protocol */ |
682 | 2 | #define PCPP_PPP_BACP 0xc02b |
683 | | /** BAP Bandwidth Allocation Protocol */ |
684 | 2 | #define PCPP_PPP_BAP 0xc02d |
685 | | /** Vendor-Specific Authentication Protocol (VSAP) */ |
686 | 2 | #define PCPP_PPP_VSAP 0xc05b |
687 | | /** Container Control Protocol */ |
688 | 2 | #define PCPP_PPP_CONTCP 0xc081 |
689 | | /** Challenge Handshake Authentication Protocol */ |
690 | 2 | #define PCPP_PPP_CHAP 0xc223 |
691 | | /** RSA Authentication Protocol */ |
692 | 2 | #define PCPP_PPP_RSAAP 0xc225 |
693 | | /** Extensible Authentication Protocol */ |
694 | 2 | #define PCPP_PPP_EAP 0xc227 |
695 | | /** Mitsubishi Security Information Exchange Protocol (SIEP) */ |
696 | 2 | #define PCPP_PPP_SIEP 0xc229 |
697 | | /** Stampede Bridging Authorization Protocol */ |
698 | 2 | #define PCPP_PPP_SBAP 0xc26f |
699 | | /** Proprietary Authentication Protocol */ |
700 | 2 | #define PCPP_PPP_PRPAP 0xc281 |
701 | | /** Proprietary Authentication Protocol */ |
702 | 2 | #define PCPP_PPP_PRPAP2 0xc283 |
703 | | /** Proprietary Node ID Authentication Protocol */ |
704 | 2 | #define PCPP_PPP_PRPNIAP 0xc481 |
705 | | |
706 | | } // namespace pcpp |
707 | | |
708 | | #endif /* PACKETPP_PPPOE_LAYER */ |