summaryrefslogtreecommitdiffstats
path: root/src/plugins/mss_clamp/mss_clamp.api
blob: e1b9fdea6cb7f58bfc096ce551fd2dcf52f2325d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/* Hey Emacs use -*- mode: C -*- */
/*
 * Copyright (c) 2016 Cisco and/or its affiliates.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at:
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

option version = "1.0.0";
import "vnet/interface_types.api";

/** \brief TCP MSS Clamping direction flag
 */
enumflag mss_clamp_dir : u8 {
    MSS_CLAMP_DIR_NONE = 0x0,
    MSS_CLAMP_DIR_RX = 0x1,
    MSS_CLAMP_DIR_TX = 0x2,
};

/** \brief Enable/Disable TCP MSS Clamping feature on an interface
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param sw_if_index - interface index on which clamping will be applied
    @param ipv4_mss - Maximum Segment Size for IPv4/TCP
    @param ipv6_mss - Maximum Segment Size for IPv6/TCP
    @param ipv4_direction - Direction clamping is enabled on (IPv4/TCP)
    @param ipv6_direction - Direction clamping is enabled on (IPv6/TCP)
 */
autoreply define mss_clamp_enable_disable {
    u32 client_index;
    u32 context;
    vl_api_interface_index_t sw_if_index;
    u16 ipv4_mss;
    u16 ipv6_mss;
    vl_api_mss_clamp_dir_t ipv4_direction;
    vl_api_mss_clamp_dir_t ipv6_direction;
};


/** \brief Get the list of configured mss values
    @param client_index - opaque cookie to identify the sender
*/
service {
  rpc mss_clamp_get returns mss_clamp_get_reply
    stream mss_clamp_details;
};

/** \brief Get the TCP MSS Clamping feature settings
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param cursor - cursor to continue when there is more to read
    @param sw_if_index - interface index to filter the result,
			 ~0 means no filter
 */
define mss_clamp_get {
    u32 client_index;
    u32 context;
    u32 cursor;
    vl_api_interface_index_t sw_if_index;
};

/** \brief Reply for get TCP MSS Clamping feature settings request
    @param context - returned sender context, to match reply w/ request
    @param retval - return code
    @param cursor - cursor to continue when there is more to read
 */
define mss_clamp_get_reply {
    u32 context;
    i32 retval;
    u32 cursor;
};

/** \brief Configured MSS values on an interface
    @param context - returned sender context, to match reply w/ request
    @param sw_if_index - interface index on which clamping is applied
    @param ipv4_mss - Maximum Segment Size for IPv4/TCP
    @param ipv6_mss - Maximum Segment Size for IPv6/TCP
    @param ipv4_direction - Direction clamping is enabled on (IPv4/TCP)
    @param ipv6_direction - Direction clamping is enabled on (IPv6/TCP)
 */
define mss_clamp_details {
    u32 context;
    vl_api_interface_index_t sw_if_index;
    u16 ipv4_mss;
    u16 ipv6_mss;
    vl_api_mss_clamp_dir_t ipv4_direction;
    vl_api_mss_clamp_dir_t ipv6_direction;
};

counters mss_clamp {
  clamped {
    severity info;
    type counter64;
    units "packets";
    description "packets clamped";
  };
};
paths {
  "/err/tcp-mss-clamping-ip4-in" "mss-clamp";
  "/err/tcp-mss-clamping-ip4-out" "mss-clamp";
  "/err/tcp-mss-clamping-ip6-in" "mss-clamp";
  "/err/tcp-mss-clamping-ip6-out" "mss-clamp";
};