Neale Ranns | 32e1c01 | 2016-11-22 17:07:28 +0000 | [diff] [blame] | 1 | /* |
| 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 | */ |
| 29 | typedef 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 | |
| 43 | extern void mfib_signal_push(const mfib_entry_t *mfe, |
| 44 | mfib_itf_t *mfi, |
| 45 | vlib_buffer_t *b0); |
| 46 | extern void mfib_signal_remove_itf(const mfib_itf_t *mfi); |
| 47 | |
| 48 | extern void mfib_signal_module_init(void); |
| 49 | |
Florin Coras | af0ff5a | 2018-01-10 08:17:03 -0800 | [diff] [blame] | 50 | struct vl_api_registration_; |
Neale Ranns | 32e1c01 | 2016-11-22 17:07:28 +0000 | [diff] [blame] | 51 | |
Florin Coras | af0ff5a | 2018-01-10 08:17:03 -0800 | [diff] [blame] | 52 | extern void vl_mfib_signal_send_one(struct vl_api_registration_ *q, |
Neale Ranns | 32e1c01 | 2016-11-22 17:07:28 +0000 | [diff] [blame] | 53 | u32 context, |
| 54 | const mfib_signal_t *mfs); |
Florin Coras | af0ff5a | 2018-01-10 08:17:03 -0800 | [diff] [blame] | 55 | extern int mfib_signal_send_one(struct vl_api_registration_ *reg, |
Neale Ranns | 32e1c01 | 2016-11-22 17:07:28 +0000 | [diff] [blame] | 56 | u32 context); |
| 57 | |
| 58 | #endif |
| 59 | |