FD.io VPP
v16.09
Vector Packet Processing
Main Page
Related Pages
Data Structures
Source
Files
Symbols
ip_source_and_port_range_check.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
16
#ifndef included_ip_ip_source_and_port_range_check_h
17
#define included_ip_ip_source_and_port_range_check_h
18
19
20
typedef
struct
21
{
22
u32
ranges_per_adjacency
;
23
u32
special_adjacency_format_function_index
;
24
25
/* convenience */
26
vlib_main_t
*
vlib_main
;
27
vnet_main_t
*
vnet_main
;
28
}
source_range_check_main_t
;
29
30
source_range_check_main_t
source_range_check_main
;
31
32
typedef
enum
33
{
34
IP_SOURCE_AND_PORT_RANGE_CHECK_PROTOCOL_TCP_OUT
,
35
IP_SOURCE_AND_PORT_RANGE_CHECK_PROTOCOL_UDP_OUT
,
36
IP_SOURCE_AND_PORT_RANGE_CHECK_PROTOCOL_TCP_IN
,
37
IP_SOURCE_AND_PORT_RANGE_CHECK_PROTOCOL_UDP_IN
,
38
IP_SOURCE_AND_PORT_RANGE_CHECK_N_PROTOCOLS
,
39
}
ip_source_and_port_range_check_protocol_t
;
40
41
typedef
struct
42
{
43
u32
fib_index[
IP_SOURCE_AND_PORT_RANGE_CHECK_N_PROTOCOLS
];
44
}
ip_source_and_port_range_check_config_t
;
45
46
#define IP_SOURCE_AND_PORT_RANGE_CHECK_RANGE_LIMIT VLIB_BUFFER_PRE_DATA_SIZE/(2*sizeof(u16x8));
47
48
typedef
struct
49
{
50
union
51
{
52
u16x8
as_u16x8
;
53
u16
as_u16[8];
54
};
55
}
u16x8vec_t
;
56
57
typedef
struct
58
{
59
u16x8vec_t
low
;
60
u16x8vec_t
hi
;
61
}
protocol_port_range_t
;
62
63
int
ip4_source_and_port_range_check_add_del
(
ip4_address_t
* address,
64
u32
length,
65
u32
vrf_id,
66
u16
* low_ports,
67
u16
* hi_ports,
int
is_add);
68
69
// This will be moved to another file in another patch -- for API freeze
70
int
ip6_source_and_port_range_check_add_del
(
ip6_address_t
* address,
71
u32
length,
72
u32
vrf_id,
73
u16
* low_ports,
74
u16
* hi_ports,
int
is_add);
75
76
int
set_ip_source_and_port_range_check
(
vlib_main_t
* vm,
77
u32
* fib_index,
78
u32
sw_if_index,
u32
is_add);
79
80
#endif
/* included ip_source_and_port_range_check_h */
81
82
/*
83
* fd.io coding-style-patch-verification: ON
84
*
85
* Local Variables:
86
* eval: (c-set-style "gnu")
87
* End:
88
*/
IP_SOURCE_AND_PORT_RANGE_CHECK_PROTOCOL_TCP_IN
Definition:
ip_source_and_port_range_check.h:36
ip_source_and_port_range_check_protocol_t
ip_source_and_port_range_check_protocol_t
Definition:
ip_source_and_port_range_check.h:32
IP_SOURCE_AND_PORT_RANGE_CHECK_PROTOCOL_UDP_OUT
Definition:
ip_source_and_port_range_check.h:35
ip_source_and_port_range_check_config_t
Definition:
ip_source_and_port_range_check.h:41
source_range_check_main_t::vnet_main
vnet_main_t * vnet_main
Definition:
ip_source_and_port_range_check.h:27
source_range_check_main_t
Definition:
ip_source_and_port_range_check.h:20
IP_SOURCE_AND_PORT_RANGE_CHECK_PROTOCOL_TCP_OUT
Definition:
ip_source_and_port_range_check.h:34
ip6_source_and_port_range_check_add_del
int ip6_source_and_port_range_check_add_del(ip6_address_t *address, u32 length, u32 vrf_id, u16 *low_ports, u16 *hi_ports, int is_add)
Definition:
ip4_source_and_port_range_check.c:854
IP_SOURCE_AND_PORT_RANGE_CHECK_PROTOCOL_UDP_IN
Definition:
ip_source_and_port_range_check.h:37
protocol_port_range_t::hi
u16x8vec_t hi
Definition:
ip_source_and_port_range_check.h:60
ip4_source_and_port_range_check_add_del
int ip4_source_and_port_range_check_add_del(ip4_address_t *address, u32 length, u32 vrf_id, u16 *low_ports, u16 *hi_ports, int is_add)
Definition:
ip4_source_and_port_range_check.c:864
ip4_address_t
Definition:
ip4_packet.h:49
u16x8vec_t::as_u16x8
u16x8 as_u16x8
Definition:
ip_source_and_port_range_check.h:52
IP_SOURCE_AND_PORT_RANGE_CHECK_N_PROTOCOLS
Definition:
ip_source_and_port_range_check.h:38
vnet_main_t
Definition:
vnet.h:59
u32
unsigned int u32
Definition:
types.h:88
source_range_check_main
source_range_check_main_t source_range_check_main
Definition:
ip_source_and_port_range_check.h:30
source_range_check_main_t::ranges_per_adjacency
u32 ranges_per_adjacency
Definition:
ip_source_and_port_range_check.h:22
source_range_check_main_t::special_adjacency_format_function_index
u32 special_adjacency_format_function_index
Definition:
ip_source_and_port_range_check.h:23
u16x8vec_t
Definition:
ip_source_and_port_range_check.h:48
source_range_check_main_t::vlib_main
vlib_main_t * vlib_main
Definition:
ip_source_and_port_range_check.h:26
u16
unsigned short u16
Definition:
types.h:57
vlib_main_t
Definition:
main.h:59
set_ip_source_and_port_range_check
int set_ip_source_and_port_range_check(vlib_main_t *vm, u32 *fib_index, u32 sw_if_index, u32 is_add)
Definition:
ip4_source_and_port_range_check.c:508
protocol_port_range_t::low
u16x8vec_t low
Definition:
ip_source_and_port_range_check.h:59
protocol_port_range_t
Definition:
ip_source_and_port_range_check.h:57
ip6_address_t
Definition:
ip6_packet.h:46
vnet
vnet
ip
ip_source_and_port_range_check.h
Generated on Fri Nov 18 2016 06:17:52 for FD.io VPP by
1.8.11