-
Notifications
You must be signed in to change notification settings - Fork 390
/
kstate.sandesh
368 lines (334 loc) · 9.17 KB
/
kstate.sandesh
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
/*
* Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
*/
/**
* Message definitions for kstate module
*
* This module is responsible for querying the config present in kernel
* This config can be accessed in agent introspect at kstate.xml
*
*/
/**
* Sandesh definition for component next hop in kernel
*/
struct KComponentNH {
1: i32 nh_id (link = "KNHReq");
2: i32 label (link = "KMplsInfo");
}
/**
* Sandesh definition for next hop in kernel
*/
struct KNHInfo {
1: i32 id;
2: string type;
3: string family;
4: i32 rid;
5: i32 vrf (link = "KRouteReq");
6: string flags;
7: i32 ref_cnt;
8: optional string encap_family;
9: optional i32 encap_oif_id (link = "KInterfaceReq");
10: optional i32 encap_len;
11: optional string tun_sip;
12: optional string tun_dip;
13: optional i32 tun_sport;
14: optional i32 tun_dport;
15: optional string encap;
16: optional list<KComponentNH> component_nh;
}
/**
* Sandesh definition for interface in kernel
*/
struct KInterfaceInfo {
1: i32 idx;
2: string type;
3: string flags;
4: i32 vrf (link = "KRouteReq");
5: i32 rid;
6: i32 os_idx;
7: i32 mtu;
8: string name;
9: i64 ibytes;
10: i64 ipackets;
11: i64 ierrors;
12: i64 obytes;
13: i64 opackets;
14: i64 oerrors;
15: i32 ref_cnt;
16: string mac;
17: string ip;
18: byte mirror_id;
19: i32 speed;
20: i32 duplexity;
}
/**
* Sandesh definition for route in kernel
*/
struct KRouteInfo {
1: i32 vrf_id;
2: string family;
3: string prefix;
4: i32 prefix_len;
5: i16 rid;
6: string label_flags;
7: i32 label;
8: i32 nh_id (link = "KNHReq");
}
/**
* Sandesh definition for mpls label in kernel
*/
struct KMplsInfo {
1: i16 label;
2: i16 rid;
3: i32 nhid (link = "KNHReq");
}
/**
* Sandesh definition for mirror in kernel
*/
struct KMirrorInfo {
1: i32 mirr_index;
2: i16 mirr_rid;
3: string mirr_flags;
4: i32 mirr_users;
5: i32 mirr_nhid (link = "KNHReq");
}
/**
* Sandesh definition for flow in kernel
*/
struct KFlowInfo {
1: i32 index;
2: i32 rflow;
3: string sip;
4: i32 sport;
5: string dip;
6: i32 dport;
7: byte proto;
8: i16 vrf_id;
9: string action;
10: string flags;
11: i16 d_vrf_id;
12: i32 bytes;
13: i32 pkts;
14: i32 insight;
18: i32 nhid;
19: u16 underlay_udp_sport;
15: optional byte mirror_id (link = "KMirrorReq");
16: optional byte sec_mirror_id (link = "KMirrorReq");
17: optional i16 ecmp_index;
20: optional string tcp_flags;
21: optional string drop_reason;
}
/**
* Sandesh definition for vxlan in kernel
*/
struct KVxLanInfo {
1: i16 vxlanid;
2: i16 rid;
3: i32 nhid (link = "KNHReq");
}
/**
* Request message to get interface list from kernel in agent introspect
*/
request sandesh KInterfaceReq {
1: i32 if_id = -1 // send data for given if-id, send all if -1
}
/**
* Response message for interface list from kernel in agent introspect
*/
response sandesh KInterfaceResp {
1: list<KInterfaceInfo> if_list;
}
/**
* Request message to get route list from kernel in agent introspect
*/
request sandesh KRouteReq {
1: i32 vrf_id = 0 // Send routes of vrf 0 if not specified
}
/**
* Response message for route list from kernel in agent introspect
*/
response sandesh KRouteResp {
1: list<KRouteInfo> rt_list;
}
/**
* Request message to get nexthop list from kernel in agent introspect
*/
request sandesh KNHReq {
1: i32 nh_id = -1; // send data for given nh, send all if -1
}
/**
* Request message for nexthop list from kernel in agent introspect
*/
response sandesh KNHResp {
1: list<KNHInfo> nh_list;
}
/**
* Request message to get mpls list from kernel in agent introspect
*/
request sandesh KMplsReq {
1: i16 mpls_label = -1; // send data for given mpls label, send all if -1
}
/**
* Response message for mpls list from kernel in agent introspect
*/
response sandesh KMplsResp {
1: list<KMplsInfo> mpls_list;
}
/**
* Request message to get mirror list from kernel in agent introspect
*/
request sandesh KMirrorReq {
1: i32 mirror_id = -1;
}
/**
* Response message for mirror list from kernel in agent introspect
*/
response sandesh KMirrorResp { 1: list<KMirrorInfo> mirror_list;
}
/**
* Request message to get next flow from kernel in agent introspect
*/
request sandesh NextKFlowReq {
1: string flow_handle;
}
/**
* Request message to get flow from kernel in agent introspect
*/
request sandesh KFlowReq {
1: i32 flow_idx = -1; // send data for given flow index, send all if -1
}
/**
* Response for flow from kernel in agent introspect
*/
response sandesh KFlowResp {
1: list<KFlowInfo> flow_list;
2: string flow_handle (link="NextKFlowReq");
}
/**
* Request message to get vxlan list from kernel in agent introspect
*/
request sandesh KVxLanReq {
1: i16 vxlan_label = 0; // send data for given vxlan label, send all if -1
}
/**
* Response message for vxlan list from kernel in agent introspect
*/
response sandesh KVxLanResp {
1: list<KVxLanInfo> vxlan_list;
}
/**
* Error message for invalid input in agent introspect
*/
response sandesh ErrResp {
1: string resp = " Invalid Input !!! ";
}
/**
* Error message returned by kernel
*/
response sandesh InternalErrResp {
1: string resp = " Internal Error !!! ";
}
/**
* Sandesh defenition for vrf assignmet
*/
struct KVrfAssignInfo {
1: i16 vif_index;
2: i16 vlan_id;
3: i16 vif_vrf;
}
/**
* Request message to get vrf assign list from kernel in agent introspect
*/
request sandesh KVrfAssignReq {
1: i32 vif_index = -1; // send vrf assign rules for an index. Send all if -1
}
/**
* Response message for vrf assign list from kernel in agent introspect
*/
response sandesh KVrfAssignResp {
1: list<KVrfAssignInfo> vrf_assign_list;
}
/**
* Sandesh defenition for vrf in kernel
*/
struct KVrfStatsInfo {
1: i16 vrf_id;
2: string vrf_family;
3: string vrf_type;
4: i16 vrf_rid;
5: i64 vrf_discards;
6: i64 vrf_resolves;
7: i64 vrf_receives;
8: i64 vrf_udp_tunnels;
9: i64 vrf_udp_mpls_tunnels;
10: i64 vrf_gre_mpls_tunnels;
11: i64 vrf_fabric_composites;
12: i64 vrf_l2_mcast_composites;
13: i64 vrf_ecmp_composites;
14: i64 vrf_encaps;
15: i64 vrf_vxlan_tunnels;
}
/**
* Request message to get vrf stats list from kernel in agent introspect
*/
request sandesh KVrfStatsReq {
1: i32 vrf_index = -1; // send vrf stats for an index. Send all if -1
}
/**
* Response message for vrf stats list from kernel
*/
response sandesh KVrfStatsResp {
1: list<KVrfStatsInfo> vrf_stats_list;
}
/**
* Request drop stats from kernel
*/
request sandesh KDropStatsReq {
}
/**
* Response message for drop stats from kernel
*/
response sandesh KDropStatsResp {
1: u16 ds_rid;
2: u64 ds_discard;
3: u64 ds_pull;
4: u64 ds_invalid_if;
5: u64 ds_arp_not_me;
6: u64 ds_garp_from_vm;
7: u64 ds_invalid_arp;
8: u64 ds_trap_no_if;
9: u64 ds_nowhere_to_go;
10: u64 ds_flow_queue_limit_exceeded;
11: u64 ds_flow_no_memory;
12: u64 ds_flow_invalid_protocol;
13: u64 ds_flow_nat_no_rflow;
14: u64 ds_flow_action_drop;
15: u64 ds_flow_action_invalid;
16: u64 ds_flow_unusable;
17: u64 ds_flow_table_full;
18: u64 ds_interface_tx_discard;
19: u64 ds_interface_drop;
20: u64 ds_duplicated;
21: u64 ds_push;
22: u64 ds_ttl_exceeded;
23: u64 ds_invalid_nh;
24: u64 ds_invalid_label;
25: u64 ds_invalid_protocol;
26: u64 ds_interface_rx_discard;
27: u64 ds_invalid_mcast_source;
28: u64 ds_head_alloc_fail;
29: u64 ds_head_space_reserve_fail;
30: u64 ds_pcow_fail;
31: u64 ds_flood;
32: u64 ds_mcast_clone_fail;
33: u64 ds_no_memory;
34: u64 ds_rewrite_fail;
35: u64 ds_misc;
36: u64 ds_invalid_packet;
37: u64 ds_cksum_err;
38: u64 ds_clone_fail;
39: u64 ds_no_fmd;
40: u64 ds_cloned_original;
41: u64 ds_invalid_vnid;
42: u64 ds_frag_err;
}