7e33f5123002460c8764e6744deb18c94fad6381
[govpp.git] / binapi / acl_types / acl_types.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2 // versions:
3 //  binapi-generator: v0.5.0-dev
4 //  VPP:              22.02-release
5 // source: /usr/share/vpp/api/plugins/acl_types.api.json
6
7 // Package acl_types contains generated bindings for API file acl_types.api.
8 //
9 // Contents:
10 //   1 enum
11 //   2 structs
12 //
13 package acl_types
14
15 import (
16         "strconv"
17
18         api "git.fd.io/govpp.git/api"
19         ethernet_types "git.fd.io/govpp.git/binapi/ethernet_types"
20         ip_types "git.fd.io/govpp.git/binapi/ip_types"
21 )
22
23 // This is a compile-time assertion to ensure that this generated file
24 // is compatible with the GoVPP api package it is being compiled against.
25 // A compilation error at this line likely means your copy of the
26 // GoVPP api package needs to be updated.
27 const _ = api.GoVppAPIPackageIsVersion2
28
29 const (
30         APIFile    = "acl_types"
31         APIVersion = "1.0.0"
32         VersionCrc = 0x878da4fa
33 )
34
35 // ACLAction defines enum 'acl_action'.
36 type ACLAction uint8
37
38 const (
39         ACL_ACTION_API_DENY           ACLAction = 0
40         ACL_ACTION_API_PERMIT         ACLAction = 1
41         ACL_ACTION_API_PERMIT_REFLECT ACLAction = 2
42 )
43
44 var (
45         ACLAction_name = map[uint8]string{
46                 0: "ACL_ACTION_API_DENY",
47                 1: "ACL_ACTION_API_PERMIT",
48                 2: "ACL_ACTION_API_PERMIT_REFLECT",
49         }
50         ACLAction_value = map[string]uint8{
51                 "ACL_ACTION_API_DENY":           0,
52                 "ACL_ACTION_API_PERMIT":         1,
53                 "ACL_ACTION_API_PERMIT_REFLECT": 2,
54         }
55 )
56
57 func (x ACLAction) String() string {
58         s, ok := ACLAction_name[uint8(x)]
59         if ok {
60                 return s
61         }
62         return "ACLAction(" + strconv.Itoa(int(x)) + ")"
63 }
64
65 // ACLRule defines type 'acl_rule'.
66 type ACLRule struct {
67         IsPermit               ACLAction        `binapi:"acl_action,name=is_permit" json:"is_permit,omitempty"`
68         SrcPrefix              ip_types.Prefix  `binapi:"prefix,name=src_prefix" json:"src_prefix,omitempty"`
69         DstPrefix              ip_types.Prefix  `binapi:"prefix,name=dst_prefix" json:"dst_prefix,omitempty"`
70         Proto                  ip_types.IPProto `binapi:"ip_proto,name=proto" json:"proto,omitempty"`
71         SrcportOrIcmptypeFirst uint16           `binapi:"u16,name=srcport_or_icmptype_first" json:"srcport_or_icmptype_first,omitempty"`
72         SrcportOrIcmptypeLast  uint16           `binapi:"u16,name=srcport_or_icmptype_last" json:"srcport_or_icmptype_last,omitempty"`
73         DstportOrIcmpcodeFirst uint16           `binapi:"u16,name=dstport_or_icmpcode_first" json:"dstport_or_icmpcode_first,omitempty"`
74         DstportOrIcmpcodeLast  uint16           `binapi:"u16,name=dstport_or_icmpcode_last" json:"dstport_or_icmpcode_last,omitempty"`
75         TCPFlagsMask           uint8            `binapi:"u8,name=tcp_flags_mask" json:"tcp_flags_mask,omitempty"`
76         TCPFlagsValue          uint8            `binapi:"u8,name=tcp_flags_value" json:"tcp_flags_value,omitempty"`
77 }
78
79 // MacipACLRule defines type 'macip_acl_rule'.
80 type MacipACLRule struct {
81         IsPermit   ACLAction                 `binapi:"acl_action,name=is_permit" json:"is_permit,omitempty"`
82         SrcMac     ethernet_types.MacAddress `binapi:"mac_address,name=src_mac" json:"src_mac,omitempty"`
83         SrcMacMask ethernet_types.MacAddress `binapi:"mac_address,name=src_mac_mask" json:"src_mac_mask,omitempty"`
84         SrcPrefix  ip_types.Prefix           `binapi:"prefix,name=src_prefix" json:"src_prefix,omitempty"`
85 }