DecodeFromBytes decodes the given bytes into this layer.
(data []byte, df gopacket.DecodeFeedback)
| 182 | |
| 183 | // DecodeFromBytes decodes the given bytes into this layer. |
| 184 | func (i *ICMPv6RouterSolicitation) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error { |
| 185 | // first 4 bytes are reserved followed by options |
| 186 | if len(data) < 4 { |
| 187 | df.SetTruncated() |
| 188 | return errors.New("ICMP layer less then 4 bytes for ICMPv6 router solicitation") |
| 189 | } |
| 190 | |
| 191 | // truncate old options |
| 192 | i.Options = i.Options[:0] |
| 193 | |
| 194 | return i.Options.DecodeFromBytes(data[4:], df) |
| 195 | } |
| 196 | |
| 197 | // SerializeTo writes the serialized form of this layer into the |
| 198 | // SerializationBuffer, implementing gopacket.SerializableLayer. |
nothing calls this directly
no test coverage detected