-
Notifications
You must be signed in to change notification settings - Fork 390
/
services.sandesh
808 lines (720 loc) · 14.5 KB
/
services.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
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
/*
* Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
*/
/**
* Message definitions for serviecs module.
*
* The services module is responsible to run following services in agent:
* ARP, DHCP, DNS, Ping, ICMP error generation
*
*/
/**
* Constant definitions for services module
*/
enum ServicesConsts {
MAX_SANDESH_COUNT = 256,
MAX_RETRIES = 64,
MAX_RETRY_TIMEOUT = 60,
MAX_AGING_TIMEOUT = 65535
}
/**
* Request message to get dhcp info from services introspect
*/
request sandesh DhcpInfo {
}
/**
* Request message to get dhcp info v6 from services introspect
*/
request sandesh Dhcpv6Info {
}
/**
* Request message to get arp info from agent
*/
request sandesh ArpInfo {
}
/**
* Request message to get dns info from agent
*/
request sandesh DnsInfo {
}
/**
* Request message to get icmp info from agent
*/
request sandesh IcmpInfo {
}
/**
* Request message to get icmp v6 info from agent
*/
request sandesh Icmpv6Info {
}
/**
* Request message to get meta data info from agent
*/
request sandesh MetadataInfo {
}
/**
* Request message to get all services info from agent along with packet stats
*/
request sandesh ShowAllInfo {
}
/**
* Request to reset all services info
*/
request sandesh ClearAllInfo {
}
/**
* Sandesh definition for Interface arp
*/
struct InterfaceArpStats {
1: u32 interface_index;
2: u32 arp_requests;
3: u32 arp_replies;
4: u32 arp_resolved;
}
/**
* Request message for interface arp stats
*/
request sandesh InterfaceArpStatsReq {
1: i32 interface_index = -1;
}
/**
* Request info for pkt trace
*/
request sandesh PktTraceInfo {
1: u32 num_buffers = 16;
2: u32 flow_num_buffers = 16;
}
/**
* Response message for interface arp list
*/
response sandesh InterfaceArpStatsResponse {
1: list<InterfaceArpStats> stats_list;
}
/**
* Response message for pkt stats
*/
response sandesh PktStats {
1: i32 total_rcvd;
2: i32 dhcp_rcvd;
3: i32 arp_rcvd;
4: i32 dns_rcvd;
5: i32 icmp_rcvd;
6: i32 flow_rcvd;
7: i32 dropped;
8: i32 total_sent;
9: i32 dhcp_sent;
10: i32 arp_sent;
11: i32 dns_sent;
12: i32 icmp_sent;
13: i32 dhcp_q_threshold_exceeded;
14: i32 arp_q_threshold_exceeded;
15: i32 dns_q_threshold_exceeded;
16: i32 icmp_q_threshold_exceeded;
17: i32 flow_q_threshold_exceeded;
}
/**
* Response message for dhcp statistics
*/
response sandesh DhcpStats {
1: i32 dhcp_discover;
2: i32 dhcp_request;
3: i32 dhcp_inform;
4: i32 dhcp_decline;
5: i32 dhcp_other;
6: i32 dhcp_errors;
7: i32 offers_sent;
8: i32 acks_sent;
9: i32 nacks_sent;
10: i32 relay_request;
11: i32 relay_response;
}
/**
* Response message for dhcp v6 statistics
*/
response sandesh Dhcpv6Stats {
1: i32 dhcp_solicit;
2: i32 dhcp_advertise;
3: i32 dhcp_request;
4: i32 dhcp_confirm;
5: i32 dhcp_renew;
6: i32 dhcp_rebind;
7: i32 dhcp_reply;
8: i32 dhcp_release;
9: i32 dhcp_decline;
10: i32 dhcp_reconfigure;
11: i32 information_request;
12: i32 dhcp_error;
}
/**
* Response message for arp stats
*/
response sandesh ArpStats {
1: i32 arp_entries;
2: i32 arp_requests; // received
3: i32 arp_replies; // received
4: i32 arp_gratuitous; // received
5: i32 arp_resolved;
6: i32 arp_max_retries_exceeded;
7: i32 arp_errors;
9: i32 arp_invalid_packets;
10: i32 arp_invalid_interface;
11: i32 arp_invalid_vrf;
12: i32 arp_invalid_address;
}
/**
* Response message for dns stats
*/
response sandesh DnsStats {
7: list<string> dns_resolver;
1: i32 dns_requests;
2: i32 dns_resolved;
3: i32 dns_retransmit_reqs;
4: i32 dns_unsupported;
5: i32 dns_failures;
6: i32 dns_drops;
}
/**
* Response message for icmp stats
*/
response sandesh IcmpStats {
1: i32 icmp_gw_ping;
2: i32 icmp_gw_ping_err;
3: i32 icmp_drop;
}
/**
* Response message for icmp6 stats
*/
response sandesh Icmpv6Stats {
1: i32 icmpv6_router_solicit;
2: i32 icmpv6_router_advert;
3: i32 icmpv6_ping_request;
4: i32 icmpv6_ping_response;
5: i32 icmpv6_drop;
6: i32 icmpv6_neighbor_solicit;
7: i32 icmpv6_neighbor_advert_solicited;
8: i32 icmpv6_neighbor_advert_unsolicited;
}
/**
* Response message for metadata service stats
*/
response sandesh MetadataResponse {
1: i32 metadata_server_port;
2: i32 metadata_requests;
3: i32 metadata_responses;
4: i32 metadata_proxy_sessions;
5: i32 metadata_internal_errors;
}
/**
* Response message for pkt trace info
*/
response sandesh PktTraceInfoResponse {
1: string resp = " Success !!! ";
2: u32 num_buffers;
3: u32 flow_num_buffers;
}
/**
* Response message for pkt trace info
*/
response sandesh PktErrorResp {
1: string resp = " Success !!! ";
}
/**
* Sandesh definition for icmp6
*/
struct InterfaceIcmpv6Stats {
1: u32 interface_index;
2: u32 icmpv6_router_solicit;
3: u32 icmpv6_router_advert;
4: u32 icmpv6_ping_request;
5: u32 icmpv6_ping_response;
6: u32 icmpv6_neighbor_solicit;
7: u32 icmpv6_neighbor_advert_solicited;
8: u32 icmpv6_neighbor_advert_unsolicited;
}
/**
* Request message for icmp6 stats on interface
*/
request sandesh InterfaceIcmpv6StatsReq {
1: i32 interface_index = -1;
}
/**
* Response message for icmpv6 stats on interface
*/
response sandesh InterfaceIcmpv6StatsResponse {
1: list<InterfaceIcmpv6Stats> stats_list;
}
/**
* Sandesh definition for vrouter header
*/
struct VrouterHdr {
1: i16 ifindex; // interface index
2: i16 vrf; // VRF
3: string cmd; // Command
4: i32 cmd_param; // Command specific parameter
5: i32 nh; // Nexthop
}
/**
* Sandesh definition for mac header
*/
struct MacHdr {
1: string dest_mac;
2: string src_mac;
3: string type;
}
/**
* Sandesh definition for arp header
*/
struct ArpHdr {
1: string htype;
2: string protocol;
3: i16 hw_size;
4: i16 prot_size;
5: string opcode;
6: string sender_mac;
7: string sender_ip;
8: string target_mac;
9: string target_ip;
}
/**
* Sandesh definition for ipv4 header
*/
struct Ipv4Hdr {
1: i16 vers;
2: i16 hdrlen;
3: i16 tos;
4: i16 len;
5: string id;
6: string frag;
7: i16 ttl;
8: string protocol;
9: string csum;
10: string src_ip;
11: string dest_ip;
}
/**
* Sandesh definition for ipv6 header
*/
struct Ipv6Hdr {
1: i32 flow;
2: i16 plen;
3: i16 next_hdr;
4: i16 hlim;
5: string src_ip;
6: string dest_ip;
}
/**
* Sandesh definition for icmpv4 header
*/
struct Icmpv4Hdr {
1: string type;
2: i16 code;
3: string csum;
}
/**
* Sandesh definition for icmpv6 header
*/
struct Icmpv6Hdr {
1: string type;
2: i16 code;
3: string csum;
4: string rest;
}
/**
* Sandesh definition for udp header
*/
struct UdpHdr {
1: i32 src_port;
2: i32 dest_port;
3: i16 length;
4: string csum;
}
/**
* Sandesh definition for dhcp options
*/
struct DhcpOption {
1: string type;
2: i16 len;
3: string value;
}
/**
* Sandesh definition for dhcpv4 header
*/
struct Dhcpv4Hdr {
1: string op;
2: string htype;
3: i16 hlen;
4: i16 hops;
5: string xid;
6: i16 secs;
7: string flags;
8: string ciaddr;
9: string yiaddr;
10: string siaddr;
11: string giaddr;
12: string chaddr;
13: string sname;
14: string file;
15: string cookie;
16: string dhcp_options;
17: string other_options;
}
/**
* Sandesh definition for dhcpv6 header
*/
struct Dhcpv6Header {
1: string type;
2: string xid;
3: string options;
}
/**
* Sandesh definition for dns header
*/
struct DnsHdr {
1: i32 xid;
2: string flags;
3: i16 ques;
4: i16 ans;
5: i16 auth;
6: i16 add;
7: string rest;
}
/**
* Sandesh definition for pkt data
*/
struct PktData {
1: string direction; // In or Out
2: i32 len; // length of the packet
}
/**
* Sandesh definition for arp packet
*/
struct ArpPkt {
1: PktData info;
2: VrouterHdr agent_hdr;
3: MacHdr mac_hdr;
4: ArpHdr arp_hdr;
}
/**
* Response message for arp packet list
*/
response sandesh ArpPktSandesh {
1: string type;
2: list<ArpPkt> pkt_list;
}
/**
* Sandesh definition for dhcp packet list
*/
struct DhcpPkt {
1: PktData info;
2: VrouterHdr agent_hdr;
3: MacHdr mac_hdr;
4: Ipv4Hdr ip_hdr;
5: UdpHdr udp_hdr;
6: Dhcpv4Hdr dhcp_hdr;
}
/**
* Response message for dhcp packet list
*/
response sandesh DhcpPktSandesh {
1: string type;
2: list<DhcpPkt> pkt_list;
}
/**
* Statistics for dhcpv6 packet
*/
struct Dhcpv6Pkt {
1: PktData info;
2: VrouterHdr agent_hdr;
3: MacHdr mac_hdr;
4: Ipv6Hdr ip_hdr;
5: UdpHdr udp_hdr;
6: Dhcpv6Header dhcp_hdr;
}
/**
* Response message for dhcpv6 packet list
*/
response sandesh Dhcpv6PktSandesh {
1: string type;
2: list<Dhcpv6Pkt> pkt_list;
}
/**
* Sandesh definition for dns packet
*/
struct DnsPkt {
1: PktData info;
2: VrouterHdr agent_hdr;
3: MacHdr mac_hdr;
4: Ipv4Hdr ip_hdr;
5: UdpHdr udp_hdr;
6: DnsHdr dns_hdr;
}
/**
* Response message for dns packet list
*/
response sandesh DnsPktSandesh {
1: string type;
2: list<DnsPkt> pkt_list;
}
/**
* Sandesh definition for icmp packet
*/
struct IcmpPkt {
1: PktData info;
2: VrouterHdr agent_hdr;
3: MacHdr mac_hdr;
4: Ipv4Hdr ip_hdr;
5: Icmpv4Hdr icmp_hdr;
}
/**
* Sandesh definition for icmpv6 packet
*/
struct Icmpv6Pkt {
1: PktData info;
2: VrouterHdr agent_hdr;
3: MacHdr mac_hdr;
4: Ipv6Hdr ip_hdr;
5: Icmpv6Hdr icmp_hdr;
}
/**
* Response message for icmp packet list
*/
response sandesh IcmpPktSandesh {
1: string type;
2: list<IcmpPkt> pkt_list;
}
/**
* Response message for icmpv6 packet list
*/
response sandesh Icmpv6PktSandesh {
1: string type;
2: list<Icmpv6Pkt> pkt_list;
}
/**
* Sandesh definition for packet dump
*/
struct PktDump {
1: PktData info;
2: VrouterHdr agent_hdr;
3: MacHdr mac_hdr;
4: string pkt;
}
/**
* Response message for sandesh packet list
*/
response sandesh PktSandesh {
1: string type;
2: list<PktDump> pkt_list;
}
///////////////////////////////////////////////////////////////////////////////
/**
* Sandesh definition for vm dns record
*/
struct VmDnsRecord {
1: string type;
2: string name;
3: string data;
4: i32 ttl;
5: string eclass;
}
/**
* Sandesh definition for vm dns data
*/
struct VmDnsSandesh {
1: string vm;
2: string virtual_dns;
3: string zone;
4: string is_floating;
5: list<VmDnsRecord> records;
}
/**
* Request to get agent dns entries
*/
request sandesh ShowDnsEntries {
}
/**
* Response message for agent dns service list
*/
response sandesh AgentDnsEntries {
1: list<VmDnsSandesh> dns_list;
}
/**
* Sandesh definition for virtual machine vdns
*/
struct VmVdnsDataEntry {
1: string ip;
2: string vdns_name;
}
/**
* Request message for vm vdns data
*/
request sandesh VmVdnsDataReq {
1: u32 vm_interface_index;
}
/**
* Response message for vm vdns entry list
*/
response sandesh VmVdnsDataResponse {
1: list<VmVdnsDataEntry> rlist;
}
/**
* Sandesh definition for vm vdns entries
*/
struct VmVdnsListEntry {
1: string name;
2: u32 vm_interface_index (link="VmVdnsDataReq");
}
/**
* Request message for vm vdns list
*/
request sandesh VmVdnsListReq {
}
/**
* Response message returning list of vm vdns entry
*/
response sandesh VmVdnsListResponse {
1: list<VmVdnsListEntry> rlist;
}
/**
* Sandesh definition for fip vdns entry
*/
struct FipVdnsEntry {
1: string vn;
2: string ip;
3: string vm_interface;
4: string vdns_name;
}
/**
* Request message for fip vdns
*/
request sandesh FipVdnsDataReq {
}
/**
* Response message for fip vdns data containing list of fip vdns entry
*/
response sandesh FipVdnsDataResponse {
1: list<FipVdnsEntry> rlist;
}
///////////////////////////////////////////////////////////////////////////////
/**
* Sandesh definition for arp
*/
struct ArpSandeshData {
1: string ip; // IP Address
2: string vrf; // VRF name
3: string mac; // MAC Address
4: string state; // Active / Static / Permanent / Resolving
5: string interface_name; // interface
}
/**
* Request message to show arp cache
*/
request sandesh ShowArpCache {
}
/**
* Request message to show gratuitous arp cache
*/
request sandesh ShowGratuitousArpCache {
}
/**
* Response message for cached arp
*/
response sandesh ArpCacheResp {
1: list<ArpSandeshData> arp_list;
}
///////////////////////////////////////////////////////////////////////////////
/**
* Request message for gateway dhcp lease
*/
request sandesh ShowGwDhcpLeases {
}
/**
* Sandesh definition for dhcp lease
*/
struct DhcpLeaseData {
1: string mac;
2: string ip;
3: u64 expiry_us;
4: string released;
}
/**
* Sandesh definition for gateway dhcp lease
*/
struct GwDhcpLeases {
1: string physical_interface;
2: string vm_interface;
3: list<DhcpLeaseData> leases;
}
/**
* Response message for gateway dhcp lease
*/
response sandesh GwDhcpLeasesResponse {
1: list<GwDhcpLeases> gw_leases;
}
///////////////////////////////////////////////////////////////////////////////
/**
* @description: Trace message for arp
* @type: Trace
* @severity: DEBUG
*/
trace sandesh ArpTrace {
1: string op;
2: string ip;
3: string vrf;
4: string mac;
}
/**
* @description: Trace message for arp error
* @type: Trace
* @severity: DEBUG
*/
trace sandesh ArpError {
1: string err;
}
/**
* @description: Trace message for dhcp error
* @type: Trace
* @severity: DEBUG
*/
trace sandesh DhcpError {
1: string error;
}
/**
* @description: Trace message for dhcp
* @type: Trace
* @severity: DEBUG
*/
trace sandesh DhcpTrace {
1: string msg;
}
/**
* @description: Trace message for dhcpv6 error
* @type: Trace
* @severity: DEBUG
*/
trace sandesh Dhcpv6Error {
1: string error;
}
/**
* @description: Trace message for dhcpv6
* @type: Trace
* @severity: DEBUG
*/
trace sandesh Dhcpv6Trace {
1: string msg;
}
/**
* @description: Trace message for icmpv6
* @type: Trace
* @severity: DEBUG
*/
trace sandesh Icmpv6Trace {
1: string msg;
}
/**
* @description: Trace message for meta data service
* @type: Trace
* @severity: DEBUG
*/
trace sandesh MetadataTrace {
1: string msg;
}