mss_clamp: TCP MSS clamping plugin
[vpp.git] / src / plugins / mss_clamp / mss_clamp.api
1 /* Hey Emacs use -*- mode: C -*- */
2 /*
3  * Copyright (c) 2016 Cisco and/or its affiliates.
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at:
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 option version = "1.0.0";
18 import "vnet/interface_types.api";
19
20 /** \brief TCP MSS Clamping direction flag
21  */
22 enumflag mss_clamp_dir : u8 {
23     MSS_CLAMP_DIR_NONE = 0x0,
24     MSS_CLAMP_DIR_RX = 0x1,
25     MSS_CLAMP_DIR_TX = 0x2,
26 };
27
28 /** \brief Enable/Disable TCP MSS Clamping feature on an interface
29     @param client_index - opaque cookie to identify the sender
30     @param context - sender context, to match reply w/ request
31     @param sw_if_index - interface index on which clamping will be applied
32     @param ipv4_mss - Maximum Segment Size for IPv4/TCP
33     @param ipv6_mss - Maximum Segment Size for IPv6/TCP
34     @param ipv4_direction - Direction clamping is enabled on (IPv4/TCP)
35     @param ipv6_direction - Direction clamping is enabled on (IPv6/TCP)
36  */
37 autoreply define mss_clamp_enable_disable {
38     u32 client_index;
39     u32 context;
40     vl_api_interface_index_t sw_if_index;
41     u16 ipv4_mss;
42     u16 ipv6_mss;
43     vl_api_mss_clamp_dir_t ipv4_direction;
44     vl_api_mss_clamp_dir_t ipv6_direction;
45 };
46
47
48 /** \brief Get the list of configured mss values
49     @param client_index - opaque cookie to identify the sender
50 */
51 service {
52   rpc mss_clamp_get returns mss_clamp_get_reply
53     stream mss_clamp_details;
54 };
55
56 /** \brief Get the TCP MSS Clamping feature settings
57     @param client_index - opaque cookie to identify the sender
58     @param context - sender context, to match reply w/ request
59     @param cursor - cursor to continue when there is more to read
60     @param sw_if_index - interface index to filter the result,
61                          ~0 means no filter
62  */
63 define mss_clamp_get {
64     u32 client_index;
65     u32 context;
66     u32 cursor;
67     vl_api_interface_index_t sw_if_index;
68 };
69
70 /** \brief Reply for get TCP MSS Clamping feature settings request
71     @param context - returned sender context, to match reply w/ request
72     @param retval - return code
73     @param cursor - cursor to continue when there is more to read
74  */
75 define mss_clamp_get_reply {
76     u32 context;
77     i32 retval;
78     u32 cursor;
79 };
80
81 /** \brief Configured MSS values on an interface
82     @param context - returned sender context, to match reply w/ request
83     @param sw_if_index - interface index on which clamping is applied
84     @param ipv4_mss - Maximum Segment Size for IPv4/TCP
85     @param ipv6_mss - Maximum Segment Size for IPv6/TCP
86     @param ipv4_direction - Direction clamping is enabled on (IPv4/TCP)
87     @param ipv6_direction - Direction clamping is enabled on (IPv6/TCP)
88  */
89 define mss_clamp_details {
90     u32 context;
91     vl_api_interface_index_t sw_if_index;
92     u16 ipv4_mss;
93     u16 ipv6_mss;
94     vl_api_mss_clamp_dir_t ipv4_direction;
95     vl_api_mss_clamp_dir_t ipv6_direction;
96 };
97
98 counters mss_clamp {
99   clamped {
100     severity info;
101     type counter64;
102     units "packets";
103     description "packets clamped";
104   };
105 };
106 paths {
107   "/err/tcp-mss-clamping-ip4-in" "mss-clamp";
108   "/err/tcp-mss-clamping-ip4-out" "mss-clamp";
109   "/err/tcp-mss-clamping-ip6-in" "mss-clamp";
110   "/err/tcp-mss-clamping-ip6-out" "mss-clamp";
111 };
112