FD.io VPP  v20.01-48-g3e0dafb74
Vector Packet Processing
sctp_api.c
Go to the documentation of this file.
1 /*
2  *------------------------------------------------------------------
3  * sctp_api.c - sctp-layer API
4  *
5  * Copyright (c) 2018 SUSE LLC.
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at:
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *------------------------------------------------------------------
18  */
19 
20 #include <vlib/vlib.h>
21 #include <vlibapi/api.h>
22 #include <vlibmemory/api.h>
23 
24 #include <sctp/sctp.h>
25 
26 #include <sctp/sctp.api_enum.h>
27 #include <sctp/sctp.api_types.h>
28 
29 #define REPLY_MSG_ID_BASE sctp_main.msg_id_base
31 
32 static void
35 {
37  vl_api_sctp_add_src_dst_connection_reply_t *rmp;
38  int rv;
39 
40  if (mp->is_ipv6)
42  (vm,
44  else
46  (vm,
48 
49  REPLY_MACRO (VL_API_SCTP_ADD_SRC_DST_CONNECTION_REPLY);
50 }
51 
52 static void
55 {
56  vl_api_sctp_del_src_dst_connection_reply_t *rmp;
57  int rv;
58 
59  if (mp->is_ipv6)
62  else
65 
66  REPLY_MACRO (VL_API_SCTP_ADD_SRC_DST_CONNECTION_REPLY);
67 }
68 
69 static void
71 {
73  vl_api_sctp_config_reply_t *rmp;
74  int rv;
75 
76  config.never_delay_sack = mp->never_delay_sack;
77  config.never_bundle = mp->never_bundle;
78  rv = sctp_configure (config);
79 
80  REPLY_MACRO (VL_API_SCTP_CONFIG_REPLY);
81 }
82 
83 #include <sctp/sctp.api.c>
86 {
87  /* Ask for a correctly-sized block of API message decode slots */
88  sctp_main.msg_id_base = setup_message_id_table ();
89 
90  return 0;
91 }
92 
93 /*
94  * fd.io coding-style-patch-verification: ON
95  *
96  * Local Variables:
97  * eval: (c-set-style "gnu")
98  * End:
99  */
static void vl_api_sctp_add_src_dst_connection_t_handler(vl_api_sctp_add_src_dst_connection_t *mp)
Definition: sctp_api.c:34
clib_error_t * sctp_plugin_api_hookup(vlib_main_t *vm)
Definition: sctp_api.c:85
struct _sctp_user_configuration sctp_user_configuration_t
u8 sctp_configure(sctp_user_configuration_t config)
Definition: sctp.c:415
sctp_main_t sctp_main
Definition: sctp.c:22
u8 sctp_sub_connection_add_ip4(vlib_main_t *vm, ip4_address_t *lcl_addr, ip4_address_t *rmt_addr)
Definition: sctp.c:299
#define REPLY_MACRO(t)
vlib_main_t * vm
Definition: in2out_ed.c:1810
u8 sctp_sub_connection_del_ip4(ip4_address_t *lcl_addr, ip4_address_t *rmt_addr)
Definition: sctp.c:322
static void vl_api_sctp_config_t_handler(vl_api_sctp_config_t *mp)
Definition: sctp_api.c:70
static void vl_api_sctp_del_src_dst_connection_t_handler(vl_api_sctp_del_src_dst_connection_t *mp)
Definition: sctp_api.c:54
static vlib_main_t * vlib_get_main(void)
Definition: global_funcs.h:23
u8 sctp_sub_connection_del_ip6(ip6_address_t *lcl_addr, ip6_address_t *rmt_addr)
Definition: sctp.c:379
static void setup_message_id_table(snat_main_t *sm, api_main_t *am)
Definition: nat_api.c:3410
u8 sctp_sub_connection_add_ip6(vlib_main_t *vm, ip6_address_t *lcl_addr, ip6_address_t *rmt_addr)
Definition: sctp.c:356
Configure SCTP source addresses, for active-open SCTP sessions.
Definition: sctp.api:28