FD.io VPP
v20.09-64-g4f7b92f0a
Vector Packet Processing
lpm.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2018 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
#include <
vppinfra/types.h
>
17
#include <
vppinfra/bihash_24_8.h
>
18
19
enum
lpm_type_e
{
20
LPM_TYPE_KEY32
,
21
LPM_TYPE_KEY128
,
22
};
23
24
typedef
struct
lpm_
{
25
void (*
add
) (
struct
lpm_
*lpm,
void
*addr_v,
u8
pfxlen,
u32
value
);
26
void (*
delete
) (
struct
lpm_
*lpm,
void
*addr_v,
u8
pfxlen);
27
u32
(*
lookup
) (
struct
lpm_
*lpm,
void
*addr_v,
u8
pfxlen);
28
29
/* IPv4 LPM */
30
uword
*
hash
[33];
31
32
/* IPv6 LPM */
33
BVT
(clib_bihash) bihash;
34
uword
*
prefix_lengths_bitmap
;
35
u32
prefix_length_refcount
[129];
36
}
lpm_t
;
37
38
lpm_t
*
lpm_table_init
(
enum
lpm_type_e
lpm_type);
bihash_24_8.h
u8
unsigned char u8
Definition:
types.h:56
lpm_::add
void(* add)(struct lpm_ *lpm, void *addr_v, u8 pfxlen, u32 value)
Definition:
lpm.h:25
lpm_::BVT
BVT(clib_bihash) bihash
u32
unsigned int u32
Definition:
types.h:88
lpm_::lookup
u32(* lookup)(struct lpm_ *lpm, void *addr_v, u8 pfxlen)
Definition:
lpm.h:27
lpm_type_e
lpm_type_e
Definition:
lpm.h:19
lpm_
Definition:
lpm.h:24
LPM_TYPE_KEY128
Definition:
lpm.h:21
LPM_TYPE_KEY32
Definition:
lpm.h:20
value
u8 value
Definition:
qos.api:54
lpm_t
struct lpm_ lpm_t
types.h
lpm_table_init
lpm_t * lpm_table_init(enum lpm_type_e lpm_type)
Definition:
lpm.c:157
uword
u64 uword
Definition:
types.h:112
lpm_::hash
uword * hash[33]
Definition:
lpm.h:30
lpm_::prefix_length_refcount
u32 prefix_length_refcount[129]
Definition:
lpm.h:35
lpm_::prefix_lengths_bitmap
uword * prefix_lengths_bitmap
Definition:
lpm.h:34
src
plugins
map
lpm.h
Generated on Thu Jun 3 2021 16:04:43 for FD.io VPP by
1.8.13