blob: f6609b3d8c1cbe3112e260b4d044b604d9aa0182 [file] [log] [blame]
Neale Ranns32e1c012016-11-22 17:07:28 +00001/*
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#ifndef __MFIB_SIGNAL_H__
17#define __MFIB_SIGNAL_H__
18
19#include <vlib/vlib.h>
20#include <vnet/mfib/mfib_types.h>
21#include <vnet/mfib/mfib_itf.h>
22#include <vnet/mfib/mfib_entry.h>
23
24#define MFIB_SIGNAL_BUFFER_SIZE 255
25
26/**
27 * A pair of indicies, for the entry and interface resp.
28 */
29typedef struct mfib_signal_t_
30{
31 fib_node_index_t mfs_entry;
32 index_t mfs_itf;
33
34 /**
35 * @brief A buffer copied from the DP plane that triggered the signal
36 */
37 u8 mfs_buffer[MFIB_SIGNAL_BUFFER_SIZE];
38
39 u8 mfs_buffer_len;
40} mfib_signal_t;
41
42
43extern void mfib_signal_push(const mfib_entry_t *mfe,
44 mfib_itf_t *mfi,
45 vlib_buffer_t *b0);
46extern void mfib_signal_remove_itf(const mfib_itf_t *mfi);
47
48extern void mfib_signal_module_init(void);
49
Florin Corasaf0ff5a2018-01-10 08:17:03 -080050struct vl_api_registration_;
Neale Ranns32e1c012016-11-22 17:07:28 +000051
Florin Corasaf0ff5a2018-01-10 08:17:03 -080052extern void vl_mfib_signal_send_one(struct vl_api_registration_ *q,
Neale Ranns32e1c012016-11-22 17:07:28 +000053 u32 context,
54 const mfib_signal_t *mfs);
Florin Corasaf0ff5a2018-01-10 08:17:03 -080055extern int mfib_signal_send_one(struct vl_api_registration_ *reg,
Neale Ranns32e1c012016-11-22 17:07:28 +000056 u32 context);
57
58#endif
59