c9fd0f75fb47c56d46552377c487fb2ade9b9915
[govpp.git] / internal / testbinapi / binapi2001 / syslog / syslog.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2 // versions:
3 //  binapi-generator: v0.4.0-dev
4 //  VPP:              20.01
5 // source: .vppapi/core/syslog.api.json
6
7 // Package syslog contains generated bindings for API file syslog.api.
8 //
9 // Contents:
10 //   5 aliases
11 //   5 enums
12 //   6 structs
13 //   1 union
14 //   8 messages
15 //
16 package syslog
17
18 import (
19         "fmt"
20         api "git.fd.io/govpp.git/api"
21         codec "git.fd.io/govpp.git/codec"
22         "net"
23         "strconv"
24         "strings"
25 )
26
27 // This is a compile-time assertion to ensure that this generated file
28 // is compatible with the GoVPP api package it is being compiled against.
29 // A compilation error at this line likely means your copy of the
30 // GoVPP api package needs to be updated.
31 const _ = api.GoVppAPIPackageIsVersion2
32
33 const (
34         APIFile    = "syslog"
35         APIVersion = "1.0.0"
36         VersionCrc = 0xb0790f43
37 )
38
39 // AddressFamily defines enum 'address_family'.
40 type AddressFamily uint32
41
42 const (
43         ADDRESS_IP4 AddressFamily = 0
44         ADDRESS_IP6 AddressFamily = 1
45 )
46
47 var (
48         AddressFamily_name = map[uint32]string{
49                 0: "ADDRESS_IP4",
50                 1: "ADDRESS_IP6",
51         }
52         AddressFamily_value = map[string]uint32{
53                 "ADDRESS_IP4": 0,
54                 "ADDRESS_IP6": 1,
55         }
56 )
57
58 func (x AddressFamily) String() string {
59         s, ok := AddressFamily_name[uint32(x)]
60         if ok {
61                 return s
62         }
63         return "AddressFamily(" + strconv.Itoa(int(x)) + ")"
64 }
65
66 // IPDscp defines enum 'ip_dscp'.
67 type IPDscp uint8
68
69 const (
70         IP_API_DSCP_CS0  IPDscp = 0
71         IP_API_DSCP_CS1  IPDscp = 8
72         IP_API_DSCP_AF11 IPDscp = 10
73         IP_API_DSCP_AF12 IPDscp = 12
74         IP_API_DSCP_AF13 IPDscp = 14
75         IP_API_DSCP_CS2  IPDscp = 16
76         IP_API_DSCP_AF21 IPDscp = 18
77         IP_API_DSCP_AF22 IPDscp = 20
78         IP_API_DSCP_AF23 IPDscp = 22
79         IP_API_DSCP_CS3  IPDscp = 24
80         IP_API_DSCP_AF31 IPDscp = 26
81         IP_API_DSCP_AF32 IPDscp = 28
82         IP_API_DSCP_AF33 IPDscp = 30
83         IP_API_DSCP_CS4  IPDscp = 32
84         IP_API_DSCP_AF41 IPDscp = 34
85         IP_API_DSCP_AF42 IPDscp = 36
86         IP_API_DSCP_AF43 IPDscp = 38
87         IP_API_DSCP_CS5  IPDscp = 40
88         IP_API_DSCP_EF   IPDscp = 46
89         IP_API_DSCP_CS6  IPDscp = 48
90         IP_API_DSCP_CS7  IPDscp = 50
91 )
92
93 var (
94         IPDscp_name = map[uint8]string{
95                 0:  "IP_API_DSCP_CS0",
96                 8:  "IP_API_DSCP_CS1",
97                 10: "IP_API_DSCP_AF11",
98                 12: "IP_API_DSCP_AF12",
99                 14: "IP_API_DSCP_AF13",
100                 16: "IP_API_DSCP_CS2",
101                 18: "IP_API_DSCP_AF21",
102                 20: "IP_API_DSCP_AF22",
103                 22: "IP_API_DSCP_AF23",
104                 24: "IP_API_DSCP_CS3",
105                 26: "IP_API_DSCP_AF31",
106                 28: "IP_API_DSCP_AF32",
107                 30: "IP_API_DSCP_AF33",
108                 32: "IP_API_DSCP_CS4",
109                 34: "IP_API_DSCP_AF41",
110                 36: "IP_API_DSCP_AF42",
111                 38: "IP_API_DSCP_AF43",
112                 40: "IP_API_DSCP_CS5",
113                 46: "IP_API_DSCP_EF",
114                 48: "IP_API_DSCP_CS6",
115                 50: "IP_API_DSCP_CS7",
116         }
117         IPDscp_value = map[string]uint8{
118                 "IP_API_DSCP_CS0":  0,
119                 "IP_API_DSCP_CS1":  8,
120                 "IP_API_DSCP_AF11": 10,
121                 "IP_API_DSCP_AF12": 12,
122                 "IP_API_DSCP_AF13": 14,
123                 "IP_API_DSCP_CS2":  16,
124                 "IP_API_DSCP_AF21": 18,
125                 "IP_API_DSCP_AF22": 20,
126                 "IP_API_DSCP_AF23": 22,
127                 "IP_API_DSCP_CS3":  24,
128                 "IP_API_DSCP_AF31": 26,
129                 "IP_API_DSCP_AF32": 28,
130                 "IP_API_DSCP_AF33": 30,
131                 "IP_API_DSCP_CS4":  32,
132                 "IP_API_DSCP_AF41": 34,
133                 "IP_API_DSCP_AF42": 36,
134                 "IP_API_DSCP_AF43": 38,
135                 "IP_API_DSCP_CS5":  40,
136                 "IP_API_DSCP_EF":   46,
137                 "IP_API_DSCP_CS6":  48,
138                 "IP_API_DSCP_CS7":  50,
139         }
140 )
141
142 func (x IPDscp) String() string {
143         s, ok := IPDscp_name[uint8(x)]
144         if ok {
145                 return s
146         }
147         return "IPDscp(" + strconv.Itoa(int(x)) + ")"
148 }
149
150 // IPEcn defines enum 'ip_ecn'.
151 type IPEcn uint8
152
153 const (
154         IP_API_ECN_NONE IPEcn = 0
155         IP_API_ECN_ECT0 IPEcn = 1
156         IP_API_ECN_ECT1 IPEcn = 2
157         IP_API_ECN_CE   IPEcn = 3
158 )
159
160 var (
161         IPEcn_name = map[uint8]string{
162                 0: "IP_API_ECN_NONE",
163                 1: "IP_API_ECN_ECT0",
164                 2: "IP_API_ECN_ECT1",
165                 3: "IP_API_ECN_CE",
166         }
167         IPEcn_value = map[string]uint8{
168                 "IP_API_ECN_NONE": 0,
169                 "IP_API_ECN_ECT0": 1,
170                 "IP_API_ECN_ECT1": 2,
171                 "IP_API_ECN_CE":   3,
172         }
173 )
174
175 func (x IPEcn) String() string {
176         s, ok := IPEcn_name[uint8(x)]
177         if ok {
178                 return s
179         }
180         return "IPEcn(" + strconv.Itoa(int(x)) + ")"
181 }
182
183 // IPProto defines enum 'ip_proto'.
184 type IPProto uint32
185
186 const (
187         IP_API_PROTO_HOPOPT   IPProto = 0
188         IP_API_PROTO_ICMP     IPProto = 1
189         IP_API_PROTO_IGMP     IPProto = 2
190         IP_API_PROTO_TCP      IPProto = 6
191         IP_API_PROTO_UDP      IPProto = 17
192         IP_API_PROTO_GRE      IPProto = 47
193         IP_API_PROTO_AH       IPProto = 50
194         IP_API_PROTO_ESP      IPProto = 51
195         IP_API_PROTO_EIGRP    IPProto = 88
196         IP_API_PROTO_OSPF     IPProto = 89
197         IP_API_PROTO_SCTP     IPProto = 132
198         IP_API_PROTO_RESERVED IPProto = 255
199 )
200
201 var (
202         IPProto_name = map[uint32]string{
203                 0:   "IP_API_PROTO_HOPOPT",
204                 1:   "IP_API_PROTO_ICMP",
205                 2:   "IP_API_PROTO_IGMP",
206                 6:   "IP_API_PROTO_TCP",
207                 17:  "IP_API_PROTO_UDP",
208                 47:  "IP_API_PROTO_GRE",
209                 50:  "IP_API_PROTO_AH",
210                 51:  "IP_API_PROTO_ESP",
211                 88:  "IP_API_PROTO_EIGRP",
212                 89:  "IP_API_PROTO_OSPF",
213                 132: "IP_API_PROTO_SCTP",
214                 255: "IP_API_PROTO_RESERVED",
215         }
216         IPProto_value = map[string]uint32{
217                 "IP_API_PROTO_HOPOPT":   0,
218                 "IP_API_PROTO_ICMP":     1,
219                 "IP_API_PROTO_IGMP":     2,
220                 "IP_API_PROTO_TCP":      6,
221                 "IP_API_PROTO_UDP":      17,
222                 "IP_API_PROTO_GRE":      47,
223                 "IP_API_PROTO_AH":       50,
224                 "IP_API_PROTO_ESP":      51,
225                 "IP_API_PROTO_EIGRP":    88,
226                 "IP_API_PROTO_OSPF":     89,
227                 "IP_API_PROTO_SCTP":     132,
228                 "IP_API_PROTO_RESERVED": 255,
229         }
230 )
231
232 func (x IPProto) String() string {
233         s, ok := IPProto_name[uint32(x)]
234         if ok {
235                 return s
236         }
237         return "IPProto(" + strconv.Itoa(int(x)) + ")"
238 }
239
240 // SyslogSeverity defines enum 'syslog_severity'.
241 type SyslogSeverity uint32
242
243 const (
244         SYSLOG_API_SEVERITY_EMERG  SyslogSeverity = 0
245         SYSLOG_API_SEVERITY_ALERT  SyslogSeverity = 1
246         SYSLOG_API_SEVERITY_CRIT   SyslogSeverity = 2
247         SYSLOG_API_SEVERITY_ERR    SyslogSeverity = 3
248         SYSLOG_API_SEVERITY_WARN   SyslogSeverity = 4
249         SYSLOG_API_SEVERITY_NOTICE SyslogSeverity = 5
250         SYSLOG_API_SEVERITY_INFO   SyslogSeverity = 6
251         SYSLOG_API_SEVERITY_DBG    SyslogSeverity = 7
252 )
253
254 var (
255         SyslogSeverity_name = map[uint32]string{
256                 0: "SYSLOG_API_SEVERITY_EMERG",
257                 1: "SYSLOG_API_SEVERITY_ALERT",
258                 2: "SYSLOG_API_SEVERITY_CRIT",
259                 3: "SYSLOG_API_SEVERITY_ERR",
260                 4: "SYSLOG_API_SEVERITY_WARN",
261                 5: "SYSLOG_API_SEVERITY_NOTICE",
262                 6: "SYSLOG_API_SEVERITY_INFO",
263                 7: "SYSLOG_API_SEVERITY_DBG",
264         }
265         SyslogSeverity_value = map[string]uint32{
266                 "SYSLOG_API_SEVERITY_EMERG":  0,
267                 "SYSLOG_API_SEVERITY_ALERT":  1,
268                 "SYSLOG_API_SEVERITY_CRIT":   2,
269                 "SYSLOG_API_SEVERITY_ERR":    3,
270                 "SYSLOG_API_SEVERITY_WARN":   4,
271                 "SYSLOG_API_SEVERITY_NOTICE": 5,
272                 "SYSLOG_API_SEVERITY_INFO":   6,
273                 "SYSLOG_API_SEVERITY_DBG":    7,
274         }
275 )
276
277 func (x SyslogSeverity) String() string {
278         s, ok := SyslogSeverity_name[uint32(x)]
279         if ok {
280                 return s
281         }
282         return "SyslogSeverity(" + strconv.Itoa(int(x)) + ")"
283 }
284
285 // AddressWithPrefix defines alias 'address_with_prefix'.
286 type AddressWithPrefix Prefix
287
288 func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
289         prefix, err := ParsePrefix(s)
290         if err != nil {
291                 return AddressWithPrefix{}, err
292         }
293         return AddressWithPrefix(prefix), nil
294 }
295 func (x AddressWithPrefix) String() string {
296         return Prefix(x).String()
297 }
298 func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
299         return []byte(x.String()), nil
300 }
301 func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
302         prefix, err := ParseAddressWithPrefix(string(text))
303         if err != nil {
304                 return err
305         }
306         *x = prefix
307         return nil
308 }
309
310 // IP4Address defines alias 'ip4_address'.
311 type IP4Address [4]uint8
312
313 func ParseIP4Address(s string) (IP4Address, error) {
314         ip := net.ParseIP(s).To4()
315         if ip == nil {
316                 return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
317         }
318         var ipaddr IP4Address
319         copy(ipaddr[:], ip.To4())
320         return ipaddr, nil
321 }
322
323 func (x IP4Address) ToIP() net.IP {
324         return net.IP(x[:]).To4()
325 }
326 func (x IP4Address) String() string {
327         return x.ToIP().String()
328 }
329 func (x *IP4Address) MarshalText() ([]byte, error) {
330         return []byte(x.String()), nil
331 }
332 func (x *IP4Address) UnmarshalText(text []byte) error {
333         ipaddr, err := ParseIP4Address(string(text))
334         if err != nil {
335                 return err
336         }
337         *x = ipaddr
338         return nil
339 }
340
341 // IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
342 type IP4AddressWithPrefix IP4Prefix
343
344 // IP6Address defines alias 'ip6_address'.
345 type IP6Address [16]uint8
346
347 func ParseIP6Address(s string) (IP6Address, error) {
348         ip := net.ParseIP(s).To16()
349         if ip == nil {
350                 return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
351         }
352         var ipaddr IP6Address
353         copy(ipaddr[:], ip.To16())
354         return ipaddr, nil
355 }
356
357 func (x IP6Address) ToIP() net.IP {
358         return net.IP(x[:]).To16()
359 }
360 func (x IP6Address) String() string {
361         return x.ToIP().String()
362 }
363 func (x *IP6Address) MarshalText() ([]byte, error) {
364         return []byte(x.String()), nil
365 }
366 func (x *IP6Address) UnmarshalText(text []byte) error {
367         ipaddr, err := ParseIP6Address(string(text))
368         if err != nil {
369                 return err
370         }
371         *x = ipaddr
372         return nil
373 }
374
375 // IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
376 type IP6AddressWithPrefix IP6Prefix
377
378 // Address defines type 'address'.
379 type Address struct {
380         Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
381         Un AddressUnion  `binapi:"address_union,name=un" json:"un,omitempty"`
382 }
383
384 func ParseAddress(s string) (Address, error) {
385         ip := net.ParseIP(s)
386         if ip == nil {
387                 return Address{}, fmt.Errorf("invalid address: %s", s)
388         }
389         var addr Address
390         if ip.To4() == nil {
391                 addr.Af = ADDRESS_IP6
392                 var ip6 IP6Address
393                 copy(ip6[:], ip.To16())
394                 addr.Un.SetIP6(ip6)
395         } else {
396                 addr.Af = ADDRESS_IP4
397                 var ip4 IP4Address
398                 copy(ip4[:], ip.To4())
399                 addr.Un.SetIP4(ip4)
400         }
401         return addr, nil
402 }
403 func (x Address) ToIP() net.IP {
404         if x.Af == ADDRESS_IP6 {
405                 ip6 := x.Un.GetIP6()
406                 return net.IP(ip6[:]).To16()
407         } else {
408                 ip4 := x.Un.GetIP4()
409                 return net.IP(ip4[:]).To4()
410         }
411 }
412 func (x Address) String() string {
413         return x.ToIP().String()
414 }
415 func (x *Address) MarshalText() ([]byte, error) {
416         return []byte(x.String()), nil
417 }
418 func (x *Address) UnmarshalText(text []byte) error {
419         addr, err := ParseAddress(string(text))
420         if err != nil {
421                 return err
422         }
423         *x = addr
424         return nil
425 }
426
427 // IP4Prefix defines type 'ip4_prefix'.
428 type IP4Prefix struct {
429         Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
430         Len     uint8      `binapi:"u8,name=len" json:"len,omitempty"`
431 }
432
433 func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
434         hasPrefix := strings.Contains(s, "/")
435         if hasPrefix {
436                 ip, network, err := net.ParseCIDR(s)
437                 if err != nil {
438                         return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
439                 }
440                 maskSize, _ := network.Mask.Size()
441                 prefix.Len = byte(maskSize)
442                 prefix.Address, err = ParseIP4Address(ip.String())
443                 if err != nil {
444                         return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
445                 }
446         } else {
447                 ip := net.ParseIP(s)
448                 defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
449                 if ip.To4() == nil {
450                         defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
451                 }
452                 prefix.Len = byte(defaultMaskSize)
453                 prefix.Address, err = ParseIP4Address(ip.String())
454                 if err != nil {
455                         return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
456                 }
457         }
458         return prefix, nil
459 }
460 func (x IP4Prefix) ToIPNet() *net.IPNet {
461         mask := net.CIDRMask(int(x.Len), 32)
462         ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
463         return ipnet
464 }
465 func (x IP4Prefix) String() string {
466         ip := x.Address.String()
467         return ip + "/" + strconv.Itoa(int(x.Len))
468 }
469 func (x *IP4Prefix) MarshalText() ([]byte, error) {
470         return []byte(x.String()), nil
471 }
472 func (x *IP4Prefix) UnmarshalText(text []byte) error {
473         prefix, err := ParseIP4Prefix(string(text))
474         if err != nil {
475                 return err
476         }
477         *x = prefix
478         return nil
479 }
480
481 // IP6Prefix defines type 'ip6_prefix'.
482 type IP6Prefix struct {
483         Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
484         Len     uint8      `binapi:"u8,name=len" json:"len,omitempty"`
485 }
486
487 func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
488         hasPrefix := strings.Contains(s, "/")
489         if hasPrefix {
490                 ip, network, err := net.ParseCIDR(s)
491                 if err != nil {
492                         return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
493                 }
494                 maskSize, _ := network.Mask.Size()
495                 prefix.Len = byte(maskSize)
496                 prefix.Address, err = ParseIP6Address(ip.String())
497                 if err != nil {
498                         return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
499                 }
500         } else {
501                 ip := net.ParseIP(s)
502                 defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
503                 if ip.To4() == nil {
504                         defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
505                 }
506                 prefix.Len = byte(defaultMaskSize)
507                 prefix.Address, err = ParseIP6Address(ip.String())
508                 if err != nil {
509                         return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
510                 }
511         }
512         return prefix, nil
513 }
514 func (x IP6Prefix) ToIPNet() *net.IPNet {
515         mask := net.CIDRMask(int(x.Len), 128)
516         ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
517         return ipnet
518 }
519 func (x IP6Prefix) String() string {
520         ip := x.Address.String()
521         return ip + "/" + strconv.Itoa(int(x.Len))
522 }
523 func (x *IP6Prefix) MarshalText() ([]byte, error) {
524         return []byte(x.String()), nil
525 }
526 func (x *IP6Prefix) UnmarshalText(text []byte) error {
527         prefix, err := ParseIP6Prefix(string(text))
528         if err != nil {
529                 return err
530         }
531         *x = prefix
532         return nil
533 }
534
535 // Mprefix defines type 'mprefix'.
536 type Mprefix struct {
537         Af               AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
538         GrpAddressLength uint16        `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
539         GrpAddress       AddressUnion  `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
540         SrcAddress       AddressUnion  `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
541 }
542
543 // Prefix defines type 'prefix'.
544 type Prefix struct {
545         Address Address `binapi:"address,name=address" json:"address,omitempty"`
546         Len     uint8   `binapi:"u8,name=len" json:"len,omitempty"`
547 }
548
549 func ParsePrefix(ip string) (prefix Prefix, err error) {
550         hasPrefix := strings.Contains(ip, "/")
551         if hasPrefix {
552                 netIP, network, err := net.ParseCIDR(ip)
553                 if err != nil {
554                         return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
555                 }
556                 maskSize, _ := network.Mask.Size()
557                 prefix.Len = byte(maskSize)
558                 prefix.Address, err = ParseAddress(netIP.String())
559                 if err != nil {
560                         return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
561                 }
562         } else {
563                 netIP := net.ParseIP(ip)
564                 defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
565                 if netIP.To4() == nil {
566                         defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
567                 }
568                 prefix.Len = byte(defaultMaskSize)
569                 prefix.Address, err = ParseAddress(netIP.String())
570                 if err != nil {
571                         return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
572                 }
573         }
574         return prefix, nil
575 }
576 func (x Prefix) ToIPNet() *net.IPNet {
577         var mask net.IPMask
578         if x.Address.Af == ADDRESS_IP4 {
579                 mask = net.CIDRMask(int(x.Len), 32)
580         } else {
581                 mask = net.CIDRMask(int(x.Len), 128)
582         }
583         ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
584         return ipnet
585 }
586 func (x Prefix) String() string {
587         ip := x.Address.String()
588         return ip + "/" + strconv.Itoa(int(x.Len))
589 }
590 func (x *Prefix) MarshalText() ([]byte, error) {
591         return []byte(x.String()), nil
592 }
593 func (x *Prefix) UnmarshalText(text []byte) error {
594         prefix, err := ParsePrefix(string(text))
595         if err != nil {
596                 return err
597         }
598         *x = prefix
599         return nil
600 }
601
602 // PrefixMatcher defines type 'prefix_matcher'.
603 type PrefixMatcher struct {
604         Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
605         Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
606 }
607
608 // AddressUnion defines union 'address_union'.
609 type AddressUnion struct {
610         // IP4 *IP4Address
611         // IP6 *IP6Address
612         XXX_UnionData [16]byte
613 }
614
615 func AddressUnionIP4(a IP4Address) (u AddressUnion) {
616         u.SetIP4(a)
617         return
618 }
619 func (u *AddressUnion) SetIP4(a IP4Address) {
620         buf := codec.NewBuffer(u.XXX_UnionData[:])
621         buf.EncodeBytes(a[:], 4)
622 }
623 func (u *AddressUnion) GetIP4() (a IP4Address) {
624         buf := codec.NewBuffer(u.XXX_UnionData[:])
625         copy(a[:], buf.DecodeBytes(4))
626         return
627 }
628
629 func AddressUnionIP6(a IP6Address) (u AddressUnion) {
630         u.SetIP6(a)
631         return
632 }
633 func (u *AddressUnion) SetIP6(a IP6Address) {
634         buf := codec.NewBuffer(u.XXX_UnionData[:])
635         buf.EncodeBytes(a[:], 16)
636 }
637 func (u *AddressUnion) GetIP6() (a IP6Address) {
638         buf := codec.NewBuffer(u.XXX_UnionData[:])
639         copy(a[:], buf.DecodeBytes(16))
640         return
641 }
642
643 // SyslogGetFilter defines message 'syslog_get_filter'.
644 type SyslogGetFilter struct{}
645
646 func (m *SyslogGetFilter) Reset()               { *m = SyslogGetFilter{} }
647 func (*SyslogGetFilter) GetMessageName() string { return "syslog_get_filter" }
648 func (*SyslogGetFilter) GetCrcString() string   { return "51077d14" }
649 func (*SyslogGetFilter) GetMessageType() api.MessageType {
650         return api.RequestMessage
651 }
652
653 func (m *SyslogGetFilter) Size() (size int) {
654         if m == nil {
655                 return 0
656         }
657         return size
658 }
659 func (m *SyslogGetFilter) Marshal(b []byte) ([]byte, error) {
660         if b == nil {
661                 b = make([]byte, m.Size())
662         }
663         buf := codec.NewBuffer(b)
664         return buf.Bytes(), nil
665 }
666 func (m *SyslogGetFilter) Unmarshal(b []byte) error {
667         return nil
668 }
669
670 // SyslogGetFilterReply defines message 'syslog_get_filter_reply'.
671 type SyslogGetFilterReply struct {
672         Retval   int32          `binapi:"i32,name=retval" json:"retval,omitempty"`
673         Severity SyslogSeverity `binapi:"syslog_severity,name=severity" json:"severity,omitempty"`
674 }
675
676 func (m *SyslogGetFilterReply) Reset()               { *m = SyslogGetFilterReply{} }
677 func (*SyslogGetFilterReply) GetMessageName() string { return "syslog_get_filter_reply" }
678 func (*SyslogGetFilterReply) GetCrcString() string   { return "eb1833f8" }
679 func (*SyslogGetFilterReply) GetMessageType() api.MessageType {
680         return api.ReplyMessage
681 }
682
683 func (m *SyslogGetFilterReply) Size() (size int) {
684         if m == nil {
685                 return 0
686         }
687         size += 4 // m.Retval
688         size += 4 // m.Severity
689         return size
690 }
691 func (m *SyslogGetFilterReply) Marshal(b []byte) ([]byte, error) {
692         if b == nil {
693                 b = make([]byte, m.Size())
694         }
695         buf := codec.NewBuffer(b)
696         buf.EncodeInt32(m.Retval)
697         buf.EncodeUint32(uint32(m.Severity))
698         return buf.Bytes(), nil
699 }
700 func (m *SyslogGetFilterReply) Unmarshal(b []byte) error {
701         buf := codec.NewBuffer(b)
702         m.Retval = buf.DecodeInt32()
703         m.Severity = SyslogSeverity(buf.DecodeUint32())
704         return nil
705 }
706
707 // SyslogGetSender defines message 'syslog_get_sender'.
708 type SyslogGetSender struct{}
709
710 func (m *SyslogGetSender) Reset()               { *m = SyslogGetSender{} }
711 func (*SyslogGetSender) GetMessageName() string { return "syslog_get_sender" }
712 func (*SyslogGetSender) GetCrcString() string   { return "51077d14" }
713 func (*SyslogGetSender) GetMessageType() api.MessageType {
714         return api.RequestMessage
715 }
716
717 func (m *SyslogGetSender) Size() (size int) {
718         if m == nil {
719                 return 0
720         }
721         return size
722 }
723 func (m *SyslogGetSender) Marshal(b []byte) ([]byte, error) {
724         if b == nil {
725                 b = make([]byte, m.Size())
726         }
727         buf := codec.NewBuffer(b)
728         return buf.Bytes(), nil
729 }
730 func (m *SyslogGetSender) Unmarshal(b []byte) error {
731         return nil
732 }
733
734 // SyslogGetSenderReply defines message 'syslog_get_sender_reply'.
735 type SyslogGetSenderReply struct {
736         Retval           int32      `binapi:"i32,name=retval" json:"retval,omitempty"`
737         SrcAddress       IP4Address `binapi:"ip4_address,name=src_address" json:"src_address,omitempty"`
738         CollectorAddress IP4Address `binapi:"ip4_address,name=collector_address" json:"collector_address,omitempty"`
739         CollectorPort    uint16     `binapi:"u16,name=collector_port" json:"collector_port,omitempty"`
740         VrfID            uint32     `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
741         MaxMsgSize       uint32     `binapi:"u32,name=max_msg_size" json:"max_msg_size,omitempty"`
742 }
743
744 func (m *SyslogGetSenderReply) Reset()               { *m = SyslogGetSenderReply{} }
745 func (*SyslogGetSenderReply) GetMessageName() string { return "syslog_get_sender_reply" }
746 func (*SyslogGetSenderReply) GetCrcString() string   { return "d3da60ac" }
747 func (*SyslogGetSenderReply) GetMessageType() api.MessageType {
748         return api.ReplyMessage
749 }
750
751 func (m *SyslogGetSenderReply) Size() (size int) {
752         if m == nil {
753                 return 0
754         }
755         size += 4     // m.Retval
756         size += 1 * 4 // m.SrcAddress
757         size += 1 * 4 // m.CollectorAddress
758         size += 2     // m.CollectorPort
759         size += 4     // m.VrfID
760         size += 4     // m.MaxMsgSize
761         return size
762 }
763 func (m *SyslogGetSenderReply) Marshal(b []byte) ([]byte, error) {
764         if b == nil {
765                 b = make([]byte, m.Size())
766         }
767         buf := codec.NewBuffer(b)
768         buf.EncodeInt32(m.Retval)
769         buf.EncodeBytes(m.SrcAddress[:], 4)
770         buf.EncodeBytes(m.CollectorAddress[:], 4)
771         buf.EncodeUint16(m.CollectorPort)
772         buf.EncodeUint32(m.VrfID)
773         buf.EncodeUint32(m.MaxMsgSize)
774         return buf.Bytes(), nil
775 }
776 func (m *SyslogGetSenderReply) Unmarshal(b []byte) error {
777         buf := codec.NewBuffer(b)
778         m.Retval = buf.DecodeInt32()
779         copy(m.SrcAddress[:], buf.DecodeBytes(4))
780         copy(m.CollectorAddress[:], buf.DecodeBytes(4))
781         m.CollectorPort = buf.DecodeUint16()
782         m.VrfID = buf.DecodeUint32()
783         m.MaxMsgSize = buf.DecodeUint32()
784         return nil
785 }
786
787 // SyslogSetFilter defines message 'syslog_set_filter'.
788 type SyslogSetFilter struct {
789         Severity SyslogSeverity `binapi:"syslog_severity,name=severity" json:"severity,omitempty"`
790 }
791
792 func (m *SyslogSetFilter) Reset()               { *m = SyslogSetFilter{} }
793 func (*SyslogSetFilter) GetMessageName() string { return "syslog_set_filter" }
794 func (*SyslogSetFilter) GetCrcString() string   { return "571348c3" }
795 func (*SyslogSetFilter) GetMessageType() api.MessageType {
796         return api.RequestMessage
797 }
798
799 func (m *SyslogSetFilter) Size() (size int) {
800         if m == nil {
801                 return 0
802         }
803         size += 4 // m.Severity
804         return size
805 }
806 func (m *SyslogSetFilter) Marshal(b []byte) ([]byte, error) {
807         if b == nil {
808                 b = make([]byte, m.Size())
809         }
810         buf := codec.NewBuffer(b)
811         buf.EncodeUint32(uint32(m.Severity))
812         return buf.Bytes(), nil
813 }
814 func (m *SyslogSetFilter) Unmarshal(b []byte) error {
815         buf := codec.NewBuffer(b)
816         m.Severity = SyslogSeverity(buf.DecodeUint32())
817         return nil
818 }
819
820 // SyslogSetFilterReply defines message 'syslog_set_filter_reply'.
821 type SyslogSetFilterReply struct {
822         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
823 }
824
825 func (m *SyslogSetFilterReply) Reset()               { *m = SyslogSetFilterReply{} }
826 func (*SyslogSetFilterReply) GetMessageName() string { return "syslog_set_filter_reply" }
827 func (*SyslogSetFilterReply) GetCrcString() string   { return "e8d4e804" }
828 func (*SyslogSetFilterReply) GetMessageType() api.MessageType {
829         return api.ReplyMessage
830 }
831
832 func (m *SyslogSetFilterReply) Size() (size int) {
833         if m == nil {
834                 return 0
835         }
836         size += 4 // m.Retval
837         return size
838 }
839 func (m *SyslogSetFilterReply) Marshal(b []byte) ([]byte, error) {
840         if b == nil {
841                 b = make([]byte, m.Size())
842         }
843         buf := codec.NewBuffer(b)
844         buf.EncodeInt32(m.Retval)
845         return buf.Bytes(), nil
846 }
847 func (m *SyslogSetFilterReply) Unmarshal(b []byte) error {
848         buf := codec.NewBuffer(b)
849         m.Retval = buf.DecodeInt32()
850         return nil
851 }
852
853 // SyslogSetSender defines message 'syslog_set_sender'.
854 type SyslogSetSender struct {
855         SrcAddress       IP4Address `binapi:"ip4_address,name=src_address" json:"src_address,omitempty"`
856         CollectorAddress IP4Address `binapi:"ip4_address,name=collector_address" json:"collector_address,omitempty"`
857         CollectorPort    uint16     `binapi:"u16,name=collector_port" json:"collector_port,omitempty"`
858         VrfID            uint32     `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
859         MaxMsgSize       uint32     `binapi:"u32,name=max_msg_size" json:"max_msg_size,omitempty"`
860 }
861
862 func (m *SyslogSetSender) Reset()               { *m = SyslogSetSender{} }
863 func (*SyslogSetSender) GetMessageName() string { return "syslog_set_sender" }
864 func (*SyslogSetSender) GetCrcString() string   { return "bb641285" }
865 func (*SyslogSetSender) GetMessageType() api.MessageType {
866         return api.RequestMessage
867 }
868
869 func (m *SyslogSetSender) Size() (size int) {
870         if m == nil {
871                 return 0
872         }
873         size += 1 * 4 // m.SrcAddress
874         size += 1 * 4 // m.CollectorAddress
875         size += 2     // m.CollectorPort
876         size += 4     // m.VrfID
877         size += 4     // m.MaxMsgSize
878         return size
879 }
880 func (m *SyslogSetSender) Marshal(b []byte) ([]byte, error) {
881         if b == nil {
882                 b = make([]byte, m.Size())
883         }
884         buf := codec.NewBuffer(b)
885         buf.EncodeBytes(m.SrcAddress[:], 4)
886         buf.EncodeBytes(m.CollectorAddress[:], 4)
887         buf.EncodeUint16(m.CollectorPort)
888         buf.EncodeUint32(m.VrfID)
889         buf.EncodeUint32(m.MaxMsgSize)
890         return buf.Bytes(), nil
891 }
892 func (m *SyslogSetSender) Unmarshal(b []byte) error {
893         buf := codec.NewBuffer(b)
894         copy(m.SrcAddress[:], buf.DecodeBytes(4))
895         copy(m.CollectorAddress[:], buf.DecodeBytes(4))
896         m.CollectorPort = buf.DecodeUint16()
897         m.VrfID = buf.DecodeUint32()
898         m.MaxMsgSize = buf.DecodeUint32()
899         return nil
900 }
901
902 // SyslogSetSenderReply defines message 'syslog_set_sender_reply'.
903 type SyslogSetSenderReply struct {
904         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
905 }
906
907 func (m *SyslogSetSenderReply) Reset()               { *m = SyslogSetSenderReply{} }
908 func (*SyslogSetSenderReply) GetMessageName() string { return "syslog_set_sender_reply" }
909 func (*SyslogSetSenderReply) GetCrcString() string   { return "e8d4e804" }
910 func (*SyslogSetSenderReply) GetMessageType() api.MessageType {
911         return api.ReplyMessage
912 }
913
914 func (m *SyslogSetSenderReply) Size() (size int) {
915         if m == nil {
916                 return 0
917         }
918         size += 4 // m.Retval
919         return size
920 }
921 func (m *SyslogSetSenderReply) Marshal(b []byte) ([]byte, error) {
922         if b == nil {
923                 b = make([]byte, m.Size())
924         }
925         buf := codec.NewBuffer(b)
926         buf.EncodeInt32(m.Retval)
927         return buf.Bytes(), nil
928 }
929 func (m *SyslogSetSenderReply) Unmarshal(b []byte) error {
930         buf := codec.NewBuffer(b)
931         m.Retval = buf.DecodeInt32()
932         return nil
933 }
934
935 func init() { file_syslog_binapi_init() }
936 func file_syslog_binapi_init() {
937         api.RegisterMessage((*SyslogGetFilter)(nil), "syslog_get_filter_51077d14")
938         api.RegisterMessage((*SyslogGetFilterReply)(nil), "syslog_get_filter_reply_eb1833f8")
939         api.RegisterMessage((*SyslogGetSender)(nil), "syslog_get_sender_51077d14")
940         api.RegisterMessage((*SyslogGetSenderReply)(nil), "syslog_get_sender_reply_d3da60ac")
941         api.RegisterMessage((*SyslogSetFilter)(nil), "syslog_set_filter_571348c3")
942         api.RegisterMessage((*SyslogSetFilterReply)(nil), "syslog_set_filter_reply_e8d4e804")
943         api.RegisterMessage((*SyslogSetSender)(nil), "syslog_set_sender_bb641285")
944         api.RegisterMessage((*SyslogSetSenderReply)(nil), "syslog_set_sender_reply_e8d4e804")
945 }
946
947 // Messages returns list of all messages in this module.
948 func AllMessages() []api.Message {
949         return []api.Message{
950                 (*SyslogGetFilter)(nil),
951                 (*SyslogGetFilterReply)(nil),
952                 (*SyslogGetSender)(nil),
953                 (*SyslogGetSenderReply)(nil),
954                 (*SyslogSetFilter)(nil),
955                 (*SyslogSetFilterReply)(nil),
956                 (*SyslogSetSender)(nil),
957                 (*SyslogSetSenderReply)(nil),
958         }
959 }