srv6-mobile: Implement SRv6 mobile API funcs
[vpp.git] / src / plugins / srv6-mobile / sr_mobile_api.h
1 /*
2  * Copyright (c) 2022 BBSakura Networks Inc 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 /**
17  * @file
18  * @brief Segment Routing for mobile u-plane api
19  *
20  */
21
22 #ifndef included_sr_mobile_api_h
23 #define included_sr_mobile_api_h
24 #include <stdint.h>
25 #include <vnet/srv6/sr.h>
26 #include <vnet/ip/ip_types_api.h>
27
28 #define srv6_mobile_strcmp_with_size(s1, s1len, s2)                           \
29   ({                                                                          \
30     int __indicator = 0;                                                      \
31     strcmp_s_inline (s1, s1len, s2, &__indicator);                            \
32     __indicator;                                                              \
33   })
34
35 void alloc_param_srv6_end_m_gtp4_e (void **plugin_mem_p,
36                                     const void *v4src_addr,
37                                     const u32 v4src_position,
38                                     const u32 fib_table);
39
40 void alloc_param_srv6_end_m_gtp6_e (void **plugin_mem_p, const u32 fib_table);
41
42 void alloc_param_srv6_end_m_gtp6_d (void **plugin_mem_p, const void *sr_prefix,
43                                     const u32 sr_prefixlen, const u8 nhtype,
44                                     const bool drop_in, const u32 fib_table);
45
46 void alloc_param_srv6_end_m_gtp6_di (void **plugin_mem_p,
47                                      const void *sr_prefix,
48                                      const u32 sr_prefixlen, const u8 nhtype);
49
50 void alloc_param_srv6_end_m_gtp6_dt (void **plugin_mem_p, const u32 fib_index,
51                                      const u32 local_fib_index,
52                                      const u32 type);
53
54 void alloc_param_srv6_t_m_gtp4_d (void **plugin_mem_p,
55                                   const void *v6src_prefix,
56                                   const u32 v6src_prefixlen,
57                                   const void *sr_prefix,
58                                   const u32 sr_prefixlen, const u32 fib_index,
59                                   const u8 nhtype, const bool drop_in);
60
61 void alloc_param_srv6_t_m_gtp4_dt (void **plugin_mem_p, const u32 fib_index,
62                                    const u32 local_fib_index, const u8 type);
63
64 #endif /* included_sr_mobile_api_h */
65
66 /*
67  * fd.io coding-style-patch-verification: ON
68  *
69  * Local Variables:
70  * eval: (c-set-style "gnu")
71  * End:
72  */