|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
21 #include <mss_clamp/mss_clamp.api_types.h>
30 if (dir4 == MSS_CLAMP_DIR_NONE && dir6 == MSS_CLAMP_DIR_NONE)
53 u8 *dir_enabled4, *dir_enabled6;
56 if (dir4 == MSS_CLAMP_DIR_NONE)
58 if (dir6 == MSS_CLAMP_DIR_NONE)
73 (*dir_enabled6) & ~dir6, 0);
76 ~(*dir_enabled6) & dir6, 1);
88 int rv = VNET_API_ERROR_FEATURE_DISABLED;
99 *mss4 = MSS_CLAMP_DIR_NONE;
112 *mss6 = MSS_CLAMP_DIR_NONE;
121 u8 *result = va_arg (*args,
u8 *);
125 dir = MSS_CLAMP_DIR_NONE;
126 else if (
unformat (input,
"enable"))
144 u8 dir4 = ~0, dir6 = ~0;
145 u32 mss4 = ~0, mss6 = ~0;
154 else if (
unformat (input,
"ip4-mss %d", &mss4))
156 else if (
unformat (input,
"ip6-mss %d", &mss6))
168 if (dir4 == (
u8) ~0 || dir6 == (
u8) ~0)
170 0,
"Please specify the MSS clamping direction for ip4 and ip6");
172 if (dir4 != MSS_CLAMP_DIR_NONE)
176 0,
"Please specify the Max Segment Size for ip4");
180 if (dir6 != MSS_CLAMP_DIR_NONE)
184 0,
"Please specify the Max Segment Size for ip6");
199 .path =
"set interface tcp-mss-clamp",
200 .short_help =
"set interface tcp-mss-clamp <interface-name> "
201 "ip4 [enable|disable|rx|tx] ip4-mss <size> "
202 "ip6 [enable|disable|rx|tx] ip6-mss <size>",
209 u8 dir = va_arg (*args,
u32);
210 u16 mss = va_arg (*args,
u32);
212 (((d) == (MSS_CLAMP_DIR_RX | MSS_CLAMP_DIR_TX)) ? \
214 (((d) == MSS_CLAMP_DIR_RX) ? " [RX]" : " [TX]"))
216 if (MSS_CLAMP_DIR_NONE == dir)
218 return format (s,
"disabled");
245 u8 dir4 =
cm->dir_enabled4[ii];
246 u8 dir6 =
cm->dir_enabled6[ii];
247 if (MSS_CLAMP_DIR_NONE != dir4 || MSS_CLAMP_DIR_NONE != dir6)
249 u16 mss4 =
cm->max_mss4[ii];
250 u16 mss6 =
cm->max_mss6[ii];
272 .path =
"show interface tcp-mss-clamp",
273 .short_help =
"show interface tcp-mss-clamp [interface-name]",
274 .long_help =
"show TCP MSS clamping configurations",
#define clib_error_return(e, args...)
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
static u8 * format_vnet_api_errno(u8 *s, va_list *args)
static clib_error_t * mssc_show_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
vnet_main_t * vnet_get_main(void)
int mssc_get_mss(u32 sw_if_index, u8 *dir4, u8 *dir6, u16 *mss4, u16 *mss6)
static void mssc_enable_disable_feat(u32 sw_if_index, u8 dir4, u8 dir6, int enable)
#define vec_foreach_index(var, v)
Iterate over vector indices.
int mssc_enable_disable(u32 sw_if_index, u8 dir4, u8 dir6, u16 mss4, u16 mss6)
vnet_feature_config_main_t * cm
#define VLIB_CLI_COMMAND(x,...)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
static u8 * format_mssc_clamping(u8 *s, va_list *args)
format_function_t format_vnet_sw_if_index_name
unformat_function_t unformat_vnet_sw_interface
description fragment has unexpected format
#define vec_validate_init_empty(V, I, INIT)
Make sure vector is long enough for given index and initialize empty space (no header,...
#define VLIB_INIT_FUNCTION(x)
static uword unformat_mssc_dir(unformat_input_t *input, va_list *args)
int vnet_feature_enable_disable(const char *arc_name, const char *node_name, u32 sw_if_index, int enable_disable, void *feature_config, u32 n_feature_config_bytes)
static vlib_cli_command_t mssc_show_command
(constructor) VLIB_CLI_COMMAND (mssc_show_command)
enumflag MSS_CLAMP_DIR_RX
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
static clib_error_t * mssc_enable_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static clib_error_t * mssc_init(vlib_main_t *vm)
static vlib_cli_command_t mssc_enable_disable_command
(constructor) VLIB_CLI_COMMAND (mssc_enable_disable_command)
enumflag MSS_CLAMP_DIR_TX
vl_api_interface_index_t sw_if_index