Commit c3b73a5
committed
Add constructor for Seg6Header
As the structure Seg6Header is tagged with `non_exhaustive`,
there is currently no way for an external library to create
a Seg6Header structure. By defining a constructor function `new`
for Seg6Header, this patch should allow to create Seg6Header
instances. In addition, this constructor checks if the segment
list is valid, i.e. if at least one segment is present,
preventing an underflow exception in `emit_value`.
Signed-off-by: Aperence <anthony.doeraene@hotmail.com>1 parent 420d181 commit c3b73a5
2 files changed
+28
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
106 | 122 | | |
107 | 123 | | |
108 | 124 | | |
| |||
115 | 131 | | |
116 | 132 | | |
117 | 133 | | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
118 | 145 | | |
119 | 146 | | |
120 | 147 | | |
| |||
0 commit comments