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