xenet_packet/
ip.rs

1use crate::PrimitiveValues;
2
3#[cfg(feature = "serde")]
4use serde::{Deserialize, Serialize};
5
6/// IP Next Level Protocol
7#[repr(u8)]
8#[derive(Clone, Copy, Debug, Hash, Eq, PartialEq)]
9#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10pub enum IpNextLevelProtocol {
11    /// IPv6 Hop-by-Hop Option \[RFC2460\]
12    Hopopt = 0,
13    /// Internet Control Message \[RFC792\]
14    Icmp = 1,
15    /// Internet Group Management \[RFC1112\]
16    Igmp = 2,
17    /// Gateway-to-Gateway \[RFC823\]
18    Ggp = 3,
19    /// IPv4 encapsulation \[RFC2003\]
20    Ipv4 = 4,
21    /// Stream \[RFC1190\]\[RFC1819\]
22    St = 5,
23    /// Transmission Control \[RFC793\]
24    Tcp = 6,
25    /// CBT
26    Cbt = 7,
27    /// Exterior Gateway Protocol \[RFC888\]
28    Egp = 8,
29    /// any private interior gateway (used by Cisco for their IGRP)
30    Igp = 9,
31    /// BBN RCC Monitoring
32    BbnRccMon = 10,
33    /// Network Voice Protocol \[RFC741\]
34    NvpII = 11,
35    /// PUP
36    Pup = 12,
37    /// ARGUS
38    Argus = 13,
39    /// EMCON
40    Emcon = 14,
41    /// Cross Net Debugger
42    Xnet = 15,
43    /// Chaos
44    Chaos = 16,
45    /// User Datagram \[RFC768\]
46    Udp = 17,
47    /// Multiplexing
48    Mux = 18,
49    /// DCN Measurement Subsystems
50    DcnMeas = 19,
51    /// Host Monitoring \[RFC869\]
52    Hmp = 20,
53    /// Packet Radio Measurement
54    Prm = 21,
55    /// XEROX NS IDP
56    XnsIdp = 22,
57    /// Trunk-1
58    Trunk1 = 23,
59    /// Trunk-2
60    Trunk2 = 24,
61    /// Leaf-1
62    Leaf1 = 25,
63    /// Leaf-2
64    Leaf2 = 26,
65    /// Reliable Data Protocol \[RFC908\]
66    Rdp = 27,
67    /// Internet Reliable Transaction \[RFC938\]
68    Irtp = 28,
69    /// ISO Transport Protocol Class 4 \[RFC905\]
70    IsoTp4 = 29,
71    /// Bulk Data Transfer Protocol \[RFC969\]
72    Netblt = 30,
73    /// MFE Network Services Protocol
74    MfeNsp = 31,
75    /// MERIT Internodal Protocol
76    MeritInp = 32,
77    /// Datagram Congestion Control Protocol \[RFC4340\]
78    Dccp = 33,
79    /// Third Party Connect Protocol
80    ThreePc = 34,
81    /// Inter-Domain Policy Routing Protocol
82    Idpr = 35,
83    /// XTP
84    Xtp = 36,
85    /// Datagram Delivery Protocol
86    Ddp = 37,
87    /// IDPR Control Message Transport Proto
88    IdprCmtp = 38,
89    /// TP++ Transport Protocol
90    TpPlusPlus = 39,
91    /// IL Transport Protocol
92    Il = 40,
93    /// IPv6 encapsulation \[RFC2473\]
94    Ipv6 = 41,
95    /// Source Demand Routing Protocol
96    Sdrp = 42,
97    /// Routing Header for IPv6
98    Ipv6Route = 43,
99    /// Fragment Header for IPv6
100    Ipv6Frag = 44,
101    /// Inter-Domain Routing Protocol
102    Idrp = 45,
103    /// Reservation Protocol \[RFC2205\]\[RFC3209\]
104    Rsvp = 46,
105    /// Generic Routing Encapsulation \[RFC1701\]
106    Gre = 47,
107    /// Dynamic Source Routing Protocol \[RFC4728\]
108    Dsr = 48,
109    /// BNA
110    Bna = 49,
111    /// Encap Security Payload \[RFC4303\]
112    Esp = 50,
113    /// Authentication Header \[RFC4302\]
114    Ah = 51,
115    /// Integrated Net Layer Security TUBA
116    INlsp = 52,
117    /// IP with Encryption
118    Swipe = 53,
119    /// NBMA Address Resolution Protocol \[RFC1735\]
120    Narp = 54,
121    /// IP Mobility
122    Mobile = 55,
123    /// Transport Layer Security Protocol using Kryptonet key management
124    Tlsp = 56,
125    /// SKIP
126    Skip = 57,
127    /// ICMPv6 \[RFC4443\]
128    Icmpv6 = 58,
129    /// No Next Header for IPv6 \[RFC2460\]
130    Ipv6NoNxt = 59,
131    /// Destination Options for IPv6 \[RFC2460\]
132    Ipv6Opts = 60,
133    /// any host internal protocol
134    HostInternal = 61,
135    /// CFTP
136    Cftp = 62,
137    /// any local network
138    LocalNetwork = 63,
139    /// SATNET and Backroom EXPAK
140    SatExpak = 64,
141    /// Kryptolan
142    Kryptolan = 65,
143    /// MIT Remote Virtual Disk Protocol
144    Rvd = 66,
145    /// Internet Pluribus Packet Core
146    Ippc = 67,
147    /// any distributed file system
148    DistributedFs = 68,
149    /// SATNET Monitoring
150    SatMon = 69,
151    /// VISA Protocol
152    Visa = 70,
153    /// Internet Packet Core Utility
154    Ipcv = 71,
155    /// Computer Protocol Network Executive
156    Cpnx = 72,
157    /// Computer Protocol Heart Beat
158    Cphb = 73,
159    /// Wang Span Network
160    Wsn = 74,
161    /// Packet Video Protocol
162    Pvp = 75,
163    /// Backroom SATNET Monitoring
164    BrSatMon = 76,
165    /// SUN ND PROTOCOL-Temporary
166    SunNd = 77,
167    /// WIDEBAND Monitoring
168    WbMon = 78,
169    /// WIDEBAND EXPAK
170    WbExpak = 79,
171    /// ISO Internet Protocol
172    IsoIp = 80,
173    /// VMTP
174    Vmtp = 81,
175    /// SECURE-VMTP
176    SecureVmtp = 82,
177    /// VINES
178    Vines = 83,
179    /// Transaction Transport Protocol/IP Traffic Manager
180    TtpOrIptm = 84,
181    /// NSFNET-IGP
182    NsfnetIgp = 85,
183    /// Dissimilar Gateway Protocol
184    Dgp = 86,
185    /// TCF
186    Tcf = 87,
187    /// EIGRP
188    Eigrp = 88,
189    /// OSPFIGP \[RFC1583\]\[RFC2328\]\[RFC5340\]
190    OspfigP = 89,
191    /// Sprite RPC Protocol
192    SpriteRpc = 90,
193    /// Locus Address Resolution Protocol
194    Larp = 91,
195    /// Multicast Transport Protocol
196    Mtp = 92,
197    /// AX.25 Frames
198    Ax25 = 93,
199    /// IP-within-IP Encapsulation Protocol
200    IpIp = 94,
201    /// Mobile Internetworking Control Pro.
202    Micp = 95,
203    /// Semaphore Communications Sec. Pro.
204    SccSp = 96,
205    /// Ethernet-within-IP Encapsulation \[RFC3378\]
206    Etherip = 97,
207    /// Encapsulation Header \[RFC1241\]
208    Encap = 98,
209    /// any private encryption scheme
210    PrivEncryption = 99,
211    /// GMTP
212    Gmtp = 100,
213    /// Ipsilon Flow Management Protocol
214    Ifmp = 101,
215    /// PNNI over IP
216    Pnni = 102,
217    /// Protocol Independent Multicast \[RFC4601\]
218    Pim = 103,
219    /// ARIS
220    Aris = 104,
221    /// SCPS
222    Scps = 105,
223    /// QNX
224    Qnx = 106,
225    /// Active Networks
226    AN = 107,
227    /// IP Payload Compression Protocol \[RFC2393\]
228    IpComp = 108,
229    /// Sitara Networks Protocol
230    Snp = 109,
231    /// Compaq Peer Protocol
232    CompaqPeer = 110,
233    /// IPX in IP
234    IpxInIp = 111,
235    /// Virtual Router Redundancy Protocol \[RFC5798\]
236    Vrrp = 112,
237    /// PGM Reliable Transport Protocol
238    Pgm = 113,
239    /// any 0-hop protocol
240    ZeroHop = 114,
241    /// Layer Two Tunneling Protocol \[RFC3931\]
242    L2tp = 115,
243    /// D-II Data Exchange (DDX)
244    Ddx = 116,
245    /// Interactive Agent Transfer Protocol
246    Iatp = 117,
247    /// Schedule Transfer Protocol
248    Stp = 118,
249    /// SpectraLink Radio Protocol
250    Srp = 119,
251    /// UTI
252    Uti = 120,
253    /// Simple Message Protocol
254    Smp = 121,
255    /// Simple Multicast Protocol
256    Sm = 122,
257    /// Performance Transparency Protocol
258    Ptp = 123,
259    ///
260    IsisOverIpv4 = 124,
261    ///
262    Fire = 125,
263    /// Combat Radio Transport Protocol
264    Crtp = 126,
265    /// Combat Radio User Datagram
266    Crudp = 127,
267    ///
268    Sscopmce = 128,
269    ///
270    Iplt = 129,
271    /// Secure Packet Shield
272    Sps = 130,
273    /// Private IP Encapsulation within IP
274    Pipe = 131,
275    /// Stream Control Transmission Protocol
276    Sctp = 132,
277    /// Fibre Channel \[RFC6172\]
278    Fc = 133,
279    /// \[RFC3175\]
280    RsvpE2eIgnore = 134,
281    /// \[RFC6275\]
282    MobilityHeader = 135,
283    /// \[RFC3828\]
284    UdpLite = 136,
285    /// \[RFC4023\]
286    MplsInIp = 137,
287    /// MANET Protocols \[RFC5498\]
288    Manet = 138,
289    /// Host Identity Protocol \[RFC5201\]
290    Hip = 139,
291    /// Shim6 Protocol \[RFC5533\]
292    Shim6 = 140,
293    /// Wrapped Encapsulating Security Payload \[RFC5840\]
294    Wesp = 141,
295    /// Robust Header Compression \[RFC5858\]
296    Rohc = 142,
297    /// Use for experimentation and testing \[RFC3692\]
298    Test1 = 253,
299    /// Use for experimentation and testing \[RFC3692\]
300    Test2 = 254,
301    /// Reserved
302    Reserved = 255,
303}
304
305impl IpNextLevelProtocol {
306    /// IpNextLevelProtocol from u8
307    pub fn new(n: u8) -> Self {
308        match n {
309            0 => Self::Hopopt,
310            1 => Self::Icmp,
311            2 => Self::Igmp,
312            3 => Self::Ggp,
313            4 => Self::Ipv4,
314            5 => Self::St,
315            6 => Self::Tcp,
316            7 => Self::Cbt,
317            8 => Self::Egp,
318            9 => Self::Igp,
319            10 => Self::BbnRccMon,
320            11 => Self::NvpII,
321            12 => Self::Pup,
322            13 => Self::Argus,
323            14 => Self::Emcon,
324            15 => Self::Xnet,
325            16 => Self::Chaos,
326            17 => Self::Udp,
327            18 => Self::Mux,
328            19 => Self::DcnMeas,
329            20 => Self::Hmp,
330            21 => Self::Prm,
331            22 => Self::XnsIdp,
332            23 => Self::Trunk1,
333            24 => Self::Trunk2,
334            25 => Self::Leaf1,
335            26 => Self::Leaf2,
336            27 => Self::Rdp,
337            28 => Self::Irtp,
338            29 => Self::IsoTp4,
339            30 => Self::Netblt,
340            31 => Self::MfeNsp,
341            32 => Self::MeritInp,
342            33 => Self::Dccp,
343            34 => Self::ThreePc,
344            35 => Self::Idpr,
345            36 => Self::Xtp,
346            37 => Self::Ddp,
347            38 => Self::IdprCmtp,
348            39 => Self::TpPlusPlus,
349            40 => Self::Il,
350            41 => Self::Ipv6,
351            42 => Self::Sdrp,
352            43 => Self::Ipv6Route,
353            44 => Self::Ipv6Frag,
354            45 => Self::Idrp,
355            46 => Self::Rsvp,
356            47 => Self::Gre,
357            48 => Self::Dsr,
358            49 => Self::Bna,
359            50 => Self::Esp,
360            51 => Self::Ah,
361            52 => Self::INlsp,
362            53 => Self::Swipe,
363            54 => Self::Narp,
364            55 => Self::Mobile,
365            56 => Self::Tlsp,
366            57 => Self::Skip,
367            58 => Self::Icmpv6,
368            59 => Self::Ipv6NoNxt,
369            60 => Self::Ipv6Opts,
370            61 => Self::HostInternal,
371            62 => Self::Cftp,
372            63 => Self::LocalNetwork,
373            64 => Self::SatExpak,
374            65 => Self::Kryptolan,
375            66 => Self::Rvd,
376            67 => Self::Ippc,
377            68 => Self::DistributedFs,
378            69 => Self::SatMon,
379            70 => Self::Visa,
380            71 => Self::Ipcv,
381            72 => Self::Cpnx,
382            73 => Self::Cphb,
383            74 => Self::Wsn,
384            75 => Self::Pvp,
385            76 => Self::BrSatMon,
386            77 => Self::SunNd,
387            78 => Self::WbMon,
388            79 => Self::WbExpak,
389            80 => Self::IsoIp,
390            81 => Self::Vmtp,
391            82 => Self::SecureVmtp,
392            83 => Self::Vines,
393            84 => Self::TtpOrIptm,
394            85 => Self::NsfnetIgp,
395            86 => Self::Dgp,
396            87 => Self::Tcf,
397            88 => Self::Eigrp,
398            89 => Self::OspfigP,
399            90 => Self::SpriteRpc,
400            91 => Self::Larp,
401            92 => Self::Mtp,
402            93 => Self::Ax25,
403            94 => Self::IpIp,
404            95 => Self::Micp,
405            96 => Self::SccSp,
406            97 => Self::Etherip,
407            98 => Self::Encap,
408            99 => Self::PrivEncryption,
409            100 => Self::Gmtp,
410            101 => Self::Ifmp,
411            102 => Self::Pnni,
412            103 => Self::Pim,
413            104 => Self::Aris,
414            105 => Self::Scps,
415            106 => Self::Qnx,
416            107 => Self::AN,
417            108 => Self::IpComp,
418            109 => Self::Snp,
419            110 => Self::CompaqPeer,
420            111 => Self::IpxInIp,
421            112 => Self::Vrrp,
422            113 => Self::Pgm,
423            114 => Self::ZeroHop,
424            115 => Self::L2tp,
425            116 => Self::Ddx,
426            117 => Self::Iatp,
427            118 => Self::Stp,
428            119 => Self::Srp,
429            120 => Self::Uti,
430            121 => Self::Smp,
431            122 => Self::Sm,
432            123 => Self::Ptp,
433            124 => Self::IsisOverIpv4,
434            125 => Self::Fire,
435            126 => Self::Crtp,
436            127 => Self::Crudp,
437            128 => Self::Sscopmce,
438            129 => Self::Iplt,
439            130 => Self::Sps,
440            131 => Self::Pipe,
441            132 => Self::Sctp,
442            133 => Self::Fc,
443            134 => Self::RsvpE2eIgnore,
444            135 => Self::MobilityHeader,
445            136 => Self::UdpLite,
446            137 => Self::MplsInIp,
447            138 => Self::Manet,
448            139 => Self::Hip,
449            140 => Self::Shim6,
450            141 => Self::Wesp,
451            142 => Self::Rohc,
452            253 => Self::Test1,
453            254 => Self::Test2,
454            _ => Self::Reserved,
455        }
456    }
457    pub fn as_str(&self) -> &'static str {
458        match self {
459            IpNextLevelProtocol::Hopopt => "Hopopt",
460            IpNextLevelProtocol::Icmp => "Icmp",
461            IpNextLevelProtocol::Igmp => "Igmp",
462            IpNextLevelProtocol::Ggp => "Ggp",
463            IpNextLevelProtocol::Ipv4 => "Ipv4",
464            IpNextLevelProtocol::St => "St",
465            IpNextLevelProtocol::Tcp => "Tcp",
466            IpNextLevelProtocol::Cbt => "Cbt",
467            IpNextLevelProtocol::Egp => "Egp",
468            IpNextLevelProtocol::Igp => "Igp",
469            IpNextLevelProtocol::BbnRccMon => "BbnRccMon",
470            IpNextLevelProtocol::NvpII => "NvpII",
471            IpNextLevelProtocol::Pup => "Pup",
472            IpNextLevelProtocol::Argus => "Argus",
473            IpNextLevelProtocol::Emcon => "Emcon",
474            IpNextLevelProtocol::Xnet => "Xnet",
475            IpNextLevelProtocol::Chaos => "Chaos",
476            IpNextLevelProtocol::Udp => "Udp",
477            IpNextLevelProtocol::Mux => "Mux",
478            IpNextLevelProtocol::DcnMeas => "DcnMeas",
479            IpNextLevelProtocol::Hmp => "Hmp",
480            IpNextLevelProtocol::Prm => "Prm",
481            IpNextLevelProtocol::XnsIdp => "XnsIdp",
482            IpNextLevelProtocol::Trunk1 => "Trunk1",
483            IpNextLevelProtocol::Trunk2 => "Trunk2",
484            IpNextLevelProtocol::Leaf1 => "Leaf1",
485            IpNextLevelProtocol::Leaf2 => "Leaf2",
486            IpNextLevelProtocol::Rdp => "Rdp",
487            IpNextLevelProtocol::Irtp => "Irtp",
488            IpNextLevelProtocol::IsoTp4 => "IsoTp4",
489            IpNextLevelProtocol::Netblt => "Netblt",
490            IpNextLevelProtocol::MfeNsp => "MfeNsp",
491            IpNextLevelProtocol::MeritInp => "MeritInp",
492            IpNextLevelProtocol::Dccp => "Dccp",
493            IpNextLevelProtocol::ThreePc => "ThreePc",
494            IpNextLevelProtocol::Idpr => "Idpr",
495            IpNextLevelProtocol::Xtp => "Xtp",
496            IpNextLevelProtocol::Ddp => "Ddp",
497            IpNextLevelProtocol::IdprCmtp => "IdprCmtp",
498            IpNextLevelProtocol::TpPlusPlus => "TpPlusPlus",
499            IpNextLevelProtocol::Il => "Il",
500            IpNextLevelProtocol::Ipv6 => "Ipv6",
501            IpNextLevelProtocol::Sdrp => "Sdrp",
502            IpNextLevelProtocol::Ipv6Route => "Ipv6Route",
503            IpNextLevelProtocol::Ipv6Frag => "Ipv6Frag",
504            IpNextLevelProtocol::Idrp => "Idrp",
505            IpNextLevelProtocol::Rsvp => "Rsvp",
506            IpNextLevelProtocol::Gre => "Gre",
507            IpNextLevelProtocol::Dsr => "Dsr",
508            IpNextLevelProtocol::Bna => "Bna",
509            IpNextLevelProtocol::Esp => "Esp",
510            IpNextLevelProtocol::Ah => "Ah",
511            IpNextLevelProtocol::INlsp => "INlsp",
512            IpNextLevelProtocol::Swipe => "Swipe",
513            IpNextLevelProtocol::Narp => "Narp",
514            IpNextLevelProtocol::Mobile => "Mobile",
515            IpNextLevelProtocol::Tlsp => "Tlsp",
516            IpNextLevelProtocol::Skip => "Skip",
517            IpNextLevelProtocol::Icmpv6 => "Icmpv6",
518            IpNextLevelProtocol::Ipv6NoNxt => "Ipv6NoNxt",
519            IpNextLevelProtocol::Ipv6Opts => "Ipv6Opts",
520            IpNextLevelProtocol::HostInternal => "HostInternal",
521            IpNextLevelProtocol::Cftp => "Cftp",
522            IpNextLevelProtocol::LocalNetwork => "LocalNetwork",
523            IpNextLevelProtocol::SatExpak => "SatExpak",
524            IpNextLevelProtocol::Kryptolan => "Kryptolan",
525            IpNextLevelProtocol::Rvd => "Rvd",
526            IpNextLevelProtocol::Ippc => "Ippc",
527            IpNextLevelProtocol::DistributedFs => "DistributedFs",
528            IpNextLevelProtocol::SatMon => "SatMon",
529            IpNextLevelProtocol::Visa => "Visa",
530            IpNextLevelProtocol::Ipcv => "Ipcv",
531            IpNextLevelProtocol::Cpnx => "Cpnx",
532            IpNextLevelProtocol::Cphb => "Cphb",
533            IpNextLevelProtocol::Wsn => "Wsn",
534            IpNextLevelProtocol::Pvp => "Pvp",
535            IpNextLevelProtocol::BrSatMon => "BrSatMon",
536            IpNextLevelProtocol::SunNd => "SunNd",
537            IpNextLevelProtocol::WbMon => "WbMon",
538            IpNextLevelProtocol::WbExpak => "WbExpak",
539            IpNextLevelProtocol::IsoIp => "IsoIp",
540            IpNextLevelProtocol::Vmtp => "Vmtp",
541            IpNextLevelProtocol::SecureVmtp => "SecureVmtp",
542            IpNextLevelProtocol::Vines => "Vines",
543            IpNextLevelProtocol::TtpOrIptm => "TtpOrIptm",
544            IpNextLevelProtocol::NsfnetIgp => "NsfnetIgp",
545            IpNextLevelProtocol::Dgp => "Dgp",
546            IpNextLevelProtocol::Tcf => "Tcf",
547            IpNextLevelProtocol::Eigrp => "Eigrp",
548            IpNextLevelProtocol::OspfigP => "OspfigP",
549            IpNextLevelProtocol::SpriteRpc => "SpriteRpc",
550            IpNextLevelProtocol::Larp => "Larp",
551            IpNextLevelProtocol::Mtp => "Mtp",
552            IpNextLevelProtocol::Ax25 => "Ax25",
553            IpNextLevelProtocol::IpIp => "IpIp",
554            IpNextLevelProtocol::Micp => "Micp",
555            IpNextLevelProtocol::SccSp => "SccSp",
556            IpNextLevelProtocol::Etherip => "Etherip",
557            IpNextLevelProtocol::Encap => "Encap",
558            IpNextLevelProtocol::PrivEncryption => "PrivEncryption",
559            IpNextLevelProtocol::Gmtp => "Gmtp",
560            IpNextLevelProtocol::Ifmp => "Ifmp",
561            IpNextLevelProtocol::Pnni => "Pnni",
562            IpNextLevelProtocol::Pim => "Pim",
563            IpNextLevelProtocol::Aris => "Aris",
564            IpNextLevelProtocol::Scps => "Scps",
565            IpNextLevelProtocol::Qnx => "Qnx",
566            IpNextLevelProtocol::AN => "AN",
567            IpNextLevelProtocol::IpComp => "IpComp",
568            IpNextLevelProtocol::Snp => "Snp",
569            IpNextLevelProtocol::CompaqPeer => "CompaqPeer",
570            IpNextLevelProtocol::IpxInIp => "IpxInIp",
571            IpNextLevelProtocol::Vrrp => "Vrrp",
572            IpNextLevelProtocol::Pgm => "Pgm",
573            IpNextLevelProtocol::ZeroHop => "ZeroHop",
574            IpNextLevelProtocol::L2tp => "L2tp",
575            IpNextLevelProtocol::Ddx => "Ddx",
576            IpNextLevelProtocol::Iatp => "Iatp",
577            IpNextLevelProtocol::Stp => "Stp",
578            IpNextLevelProtocol::Srp => "Srp",
579            IpNextLevelProtocol::Uti => "Uti",
580            IpNextLevelProtocol::Smp => "Smp",
581            IpNextLevelProtocol::Sm => "Sm",
582            IpNextLevelProtocol::Ptp => "Ptp",
583            IpNextLevelProtocol::IsisOverIpv4 => "IsisOverIpv4",
584            IpNextLevelProtocol::Fire => "Fire",
585            IpNextLevelProtocol::Crtp => "Crtp",
586            IpNextLevelProtocol::Crudp => "Crudp",
587            IpNextLevelProtocol::Sscopmce => "Sscopmce",
588            IpNextLevelProtocol::Iplt => "Iplt",
589            IpNextLevelProtocol::Sps => "Sps",
590            IpNextLevelProtocol::Pipe => "Pipe",
591            IpNextLevelProtocol::Sctp => "Sctp",
592            IpNextLevelProtocol::Fc => "Fc",
593            IpNextLevelProtocol::RsvpE2eIgnore => "RsvpE2eIgnore",
594            IpNextLevelProtocol::MobilityHeader => "MobilityHeader",
595            IpNextLevelProtocol::UdpLite => "UdpLite",
596            IpNextLevelProtocol::MplsInIp => "MplsInIp",
597            IpNextLevelProtocol::Manet => "Manet",
598            IpNextLevelProtocol::Hip => "Hip",
599            IpNextLevelProtocol::Shim6 => "Shim6",
600            IpNextLevelProtocol::Wesp => "Wesp",
601            IpNextLevelProtocol::Rohc => "Rohc",
602            IpNextLevelProtocol::Test1 => "Test1",
603            IpNextLevelProtocol::Test2 => "Test2",
604            IpNextLevelProtocol::Reserved => "Reserved",
605        }
606    }
607}
608
609impl PrimitiveValues for IpNextLevelProtocol {
610    type T = (u8,);
611    fn to_primitive_values(&self) -> (u8,) {
612        (*self as u8,)
613    }
614}