blob: 6ba40f3a839b35b69b5ce90873c850c138b39f41 [file] [log] [blame]
Neale Rannsd792d9c2017-10-21 10:53:20 -07001/*
2 * Copyright (c) 2016 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 * @brief bier_fmask_db : The BIER fmask Database
17 */
18
19#ifndef __BIER_FMASK_DB_H__
20#define __BIER_FMASK_DB_H__
21
22#include <vnet/ip/ip.h>
23
24#include <vnet/bier/bier_types.h>
25
26/**
27 * Foward declarations
28 */
29struct bier_fmask_t_;
30
31typedef enum bier_hdr_type_t_ {
32 BIER_HDR_IN_IP6,
33 BIER_HDR_O_MPLS,
34} bier_hdr_type_t;
35
36typedef struct bier_fmask_id_t_ {
37 /**
38 * Type of BIER header this fmask supports
39 */
40 bier_hdr_type_t bfmi_hdr_type;
41
42 /**
43 * next-hop of the peer
44 */
45 ip46_address_t bfmi_nh;
46} bier_fmask_id_t;
47
48extern u32
49bier_fmask_db_find_or_create_and_lock(index_t bti,
50 const bier_fmask_id_t *fmid,
51 const fib_route_path_t *rpath);
52
53extern u32
54bier_fmask_db_find(index_t bti,
55 const bier_fmask_id_t *fmid);
56
57extern void
58bier_fmask_db_remove(index_t bti,
59 const bier_fmask_id_t *fmid);
60
61#endif