Hybrid ICN (hICN) plugin
v21.06-rc0-4-g18fa668
hicn-plugin
src
hicn
protocol
icmprd.h
1
/*
2
* Copyright (c) 2017-2019 Cisco and/or its affiliates.
3
* Licensed under the Apache License, Version 2.0 (the "License");
4
* you may not use this file except in compliance with the License.
5
* You may obtain a copy of the License at:
6
*
7
* http://www.apache.org/licenses/LICENSE-2.0
8
*
9
* Unless required by applicable law or agreed to in writing, software
10
* distributed under the License is distributed on an "AS IS" BASIS,
11
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
* See the License for the specific language governing permissions and
13
* limitations under the License.
14
*/
15
20
#ifndef HICN_PROTOCOL_ICMPRD_H
21
#define HICN_PROTOCOL_ICMPRD_H
22
23
#include "../common.h"
24
#include "ipv4.h"
25
26
/*
27
* The length of the ICMPRD4 header struct must be 92 bytes.
28
*/
29
#define EXPECTED_ICMPRD4_HDRLEN 92
30
31
typedef
struct
32
{
33
u8 type;
34
u8 code;
35
u16 csum;
36
ip4_address_t
ip;
37
_ipv4_header_t
iph;
38
u8 data[64];
39
}
_icmprd4_header_t
;
40
41
#define ICMPRD4_HDRLEN sizeof(_icmprd4_header_t)
42
static_assert (EXPECTED_ICMPRD4_HDRLEN == ICMPRD4_HDRLEN,
43
"Size of ICMPWLDR struct does not match its expected size."
);
44
45
/*
46
* The length of the ICMPRD header struct must be 40 bytes.
47
*/
48
#define EXPECTED_ICMPRD_HDRLEN 40
49
50
typedef
struct
51
{
52
u8 type;
53
u8 code;
54
u16 csum;
55
u32 res;
56
ip6_address_t
tgt;
57
ip6_address_t
dst;
58
}
_icmprd_header_t
;
59
60
#define ICMPRD_HDRLEN sizeof(_icmprd_header_t)
61
static_assert (EXPECTED_ICMPRD_HDRLEN == ICMPRD_HDRLEN,
62
"Size of ICMPWLDR struct does not match its expected size."
);
63
64
#endif
/* HICN_PROTOCOL_ICMPRD_H */
65
66
/*
67
* fd.io coding-style-patch-verification: ON
68
*
69
* Local Variables:
70
* eval: (c-set-style "gnu")
71
* End:
72
*/
ip6_address_t
Definition:
common.h:173
_icmprd_header_t
Definition:
icmprd.h:50
_icmprd4_header_t
Definition:
icmprd.h:31
ip4_address_t
Definition:
common.h:167
_ipv4_header_t
Definition:
ipv4.h:30
Generated by
1.8.17