FD.io VPP
v19.01.3-6-g70449b9b9
Vector Packet Processing
oam.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2015 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
#ifndef __included_oam_h__
16
#define __included_oam_h__
17
18
#include <
vlib/vlib.h
>
19
#include <
vnet/vnet.h
>
20
#include <
vnet/ip/ip.h
>
21
#include <
vnet/interface.h
>
22
23
/* 36 octets, make a note of it... */
24
/* *INDENT-OFF* */
25
typedef
CLIB_PACKED
(
struct
{
26
ip4_header_t
ip4;
27
icmp46_header_t icmp;
28
u16
id
;
29
u16
seq;
30
u8
data[8];
31
}) oam_template_t;
32
/* *INDENT-ON* */
33
34
/* *INDENT-OFF* */
35
typedef
CLIB_PACKED
(
struct
{
36
u64
v8
[4];
37
u32
v4;
38
}) oam_template_copy_t;
39
/* *INDENT-ON* */
40
41
typedef
enum
42
{
43
OAM_STATE_UNKNOWN
= 0,
44
OAM_STATE_ALIVE
,
45
OAM_STATE_DEAD
,
46
}
oam_state_t
;
47
48
typedef
struct
49
{
50
ip4_address_t
src_address
;
51
ip4_address_t
dst_address
;
52
u32
fib_id
;
53
u32
fib_index
;
54
f64
last_heard_time
;
55
u16
seq
;
56
u16
last_heard_seq
;
57
u16
id
;
58
u8
state
;
59
oam_template_t *
template
;
60
}
oam_target_t
;
61
62
typedef
struct
63
{
64
/* OAM targets */
65
oam_target_t
*
targets
;
66
uword
*
target_by_address_and_fib_id
;
67
68
/* Config parameters */
69
f64
interval
;
70
u32
misses_allowed
;
71
72
/* random number seed */
73
u32
random_seed
;
74
u16
icmp_id
;
75
76
/* oam packet template */
77
vlib_packet_template_t
packet_template
;
78
79
/* convenience */
80
vlib_main_t
*
vlib_main
;
81
vnet_main_t
*
vnet_main
;
82
}
oam_main_t
;
83
84
int
vpe_oam_add_del_target
(
ip4_address_t
*
src_address
,
85
ip4_address_t
* dst_address,
86
u32
fib_id,
int
is_add);
87
88
#endif
/* __included_oam_h__ */
89
90
/*
91
* fd.io coding-style-patch-verification: ON
92
*
93
* Local Variables:
94
* eval: (c-set-style "gnu")
95
* End:
96
*/
OAM_STATE_DEAD
Definition:
oam.h:45
oam_target_t
Definition:
oam.h:48
oam_target_t::id
u16 id
Definition:
oam.h:57
oam_main_t::interval
f64 interval
Definition:
oam.h:69
u64
unsigned long u64
Definition:
types.h:89
v8
u8 v8
Definition:
ikev2.h:27
CLIB_PACKED
typedef CLIB_PACKED(struct { ip4_header_t ip4;icmp46_header_t icmp;u16 id;u16 seq;u8 data[8];}) oam_template_t
oam_main_t::icmp_id
u16 icmp_id
Definition:
oam.h:74
oam_target_t::last_heard_time
f64 last_heard_time
Definition:
oam.h:54
ip.h
OAM_STATE_ALIVE
Definition:
oam.h:44
u8
unsigned char u8
Definition:
types.h:56
f64
double f64
Definition:
types.h:142
oam_main_t::misses_allowed
u32 misses_allowed
Definition:
oam.h:70
oam_target_t::last_heard_seq
u16 last_heard_seq
Definition:
oam.h:56
vlib_packet_template_t
Definition:
buffer_funcs.h:965
u32
unsigned int u32
Definition:
types.h:88
oam_main_t::vlib_main
vlib_main_t * vlib_main
Definition:
oam.h:80
oam_main_t::target_by_address_and_fib_id
uword * target_by_address_and_fib_id
Definition:
oam.h:66
ip4_address_t
Definition:
ip4_packet.h:49
oam_main_t
Definition:
oam.h:62
interface.h
OAM_STATE_UNKNOWN
Definition:
oam.h:43
u16
unsigned short u16
Definition:
types.h:57
oam_state_t
oam_state_t
Definition:
oam.h:41
src_address
vl_api_address_union_t src_address
Definition:
ip_types.api:44
vnet.h
oam_main_t::packet_template
vlib_packet_template_t packet_template
Definition:
oam.h:77
oam_target_t::fib_id
u32 fib_id
Definition:
oam.h:52
vlib.h
vnet_main_t
Definition:
vnet.h:51
vpe_oam_add_del_target
int vpe_oam_add_del_target(ip4_address_t *src_address, ip4_address_t *dst_address, u32 fib_id, int is_add)
Definition:
oam.c:60
oam_target_t::src_address
ip4_address_t src_address
Definition:
oam.h:50
oam_target_t::fib_index
u32 fib_index
Definition:
oam.h:53
vlib_main_t
Definition:
main.h:61
oam_main_t::random_seed
u32 random_seed
Definition:
oam.h:73
uword
u64 uword
Definition:
types.h:112
oam_main_t::targets
oam_target_t * targets
Definition:
oam.h:65
oam_target_t::seq
u16 seq
Definition:
oam.h:55
oam_main_t::vnet_main
vnet_main_t * vnet_main
Definition:
oam.h:81
id
u32 id
Definition:
udp.api:45
oam_target_t::state
u8 state
Definition:
oam.h:58
ip4_header_t
Definition:
ip4_packet.h:132
oam_target_t::dst_address
ip4_address_t dst_address
Definition:
oam.h:51
src
vpp
oam
oam.h
Generated on Sun Dec 8 2019 18:03:41 for FD.io VPP by
1.8.13