Refactoring and fixes
[govpp.git] / binapi / ip_types / ip_types.ba.go
index b9ddb27..bebbd57 100644 (file)
@@ -1,26 +1,27 @@
 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
 // versions:
 //  binapi-generator: v0.4.0-dev
-//  VPP:              20.05-release
+//  VPP:              21.06-release
 // source: /usr/share/vpp/api/core/ip_types.api.json
 
 // Package ip_types contains generated bindings for API file ip_types.api.
 //
 // Contents:
 //   5 aliases
-//   4 enums
-//   6 structs
+//   5 enums
+//   8 structs
 //   1 union
 //
 package ip_types
 
 import (
        "fmt"
-       api "git.fd.io/govpp.git/api"
-       codec "git.fd.io/govpp.git/codec"
        "net"
        "strconv"
        "strings"
+
+       api "git.fd.io/govpp.git/api"
+       codec "git.fd.io/govpp.git/codec"
 )
 
 // This is a compile-time assertion to ensure that this generated file
@@ -173,6 +174,42 @@ func (x IPEcn) String() string {
        return "IPEcn(" + strconv.Itoa(int(x)) + ")"
 }
 
+// IPFeatureLocation defines enum 'ip_feature_location'.
+type IPFeatureLocation uint8
+
+const (
+       IP_API_FEATURE_INPUT  IPFeatureLocation = 0
+       IP_API_FEATURE_OUTPUT IPFeatureLocation = 1
+       IP_API_FEATURE_LOCAL  IPFeatureLocation = 2
+       IP_API_FEATURE_PUNT   IPFeatureLocation = 3
+       IP_API_FEATURE_DROP   IPFeatureLocation = 4
+)
+
+var (
+       IPFeatureLocation_name = map[uint8]string{
+               0: "IP_API_FEATURE_INPUT",
+               1: "IP_API_FEATURE_OUTPUT",
+               2: "IP_API_FEATURE_LOCAL",
+               3: "IP_API_FEATURE_PUNT",
+               4: "IP_API_FEATURE_DROP",
+       }
+       IPFeatureLocation_value = map[string]uint8{
+               "IP_API_FEATURE_INPUT":  0,
+               "IP_API_FEATURE_OUTPUT": 1,
+               "IP_API_FEATURE_LOCAL":  2,
+               "IP_API_FEATURE_PUNT":   3,
+               "IP_API_FEATURE_DROP":   4,
+       }
+)
+
+func (x IPFeatureLocation) String() string {
+       s, ok := IPFeatureLocation_name[uint8(x)]
+       if ok {
+               return s
+       }
+       return "IPFeatureLocation(" + strconv.Itoa(int(x)) + ")"
+}
+
 // IPProto defines enum 'ip_proto'.
 type IPProto uint8
 
@@ -375,6 +412,12 @@ func (x *Address) UnmarshalText(text []byte) error {
        return nil
 }
 
+// IP4AddressAndMask defines type 'ip4_address_and_mask'.
+type IP4AddressAndMask struct {
+       Addr IP4Address `binapi:"ip4_address,name=addr" json:"addr,omitempty"`
+       Mask IP4Address `binapi:"ip4_address,name=mask" json:"mask,omitempty"`
+}
+
 // IP4Prefix defines type 'ip4_prefix'.
 type IP4Prefix struct {
        Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
@@ -429,6 +472,12 @@ func (x *IP4Prefix) UnmarshalText(text []byte) error {
        return nil
 }
 
+// IP6AddressAndMask defines type 'ip6_address_and_mask'.
+type IP6AddressAndMask struct {
+       Addr IP6Address `binapi:"ip6_address,name=addr" json:"addr,omitempty"`
+       Mask IP6Address `binapi:"ip6_address,name=mask" json:"mask,omitempty"`
+}
+
 // IP6Prefix defines type 'ip6_prefix'.
 type IP6Prefix struct {
        Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
@@ -558,8 +607,9 @@ type PrefixMatcher struct {
 
 // AddressUnion defines union 'address_union'.
 type AddressUnion struct {
-       // IP4 *IP4Address
-       // IP6 *IP6Address
+       // AddressUnion can be one of:
+       // - IP4 *IP4Address
+       // - IP6 *IP6Address
        XXX_UnionData [16]byte
 }
 
@@ -568,11 +618,11 @@ func AddressUnionIP4(a IP4Address) (u AddressUnion) {
        return
 }
 func (u *AddressUnion) SetIP4(a IP4Address) {
-       var buf = codec.NewBuffer(u.XXX_UnionData[:])
+       buf := codec.NewBuffer(u.XXX_UnionData[:])
        buf.EncodeBytes(a[:], 4)
 }
 func (u *AddressUnion) GetIP4() (a IP4Address) {
-       var buf = codec.NewBuffer(u.XXX_UnionData[:])
+       buf := codec.NewBuffer(u.XXX_UnionData[:])
        copy(a[:], buf.DecodeBytes(4))
        return
 }
@@ -582,11 +632,11 @@ func AddressUnionIP6(a IP6Address) (u AddressUnion) {
        return
 }
 func (u *AddressUnion) SetIP6(a IP6Address) {
-       var buf = codec.NewBuffer(u.XXX_UnionData[:])
+       buf := codec.NewBuffer(u.XXX_UnionData[:])
        buf.EncodeBytes(a[:], 16)
 }
 func (u *AddressUnion) GetIP6() (a IP6Address) {
-       var buf = codec.NewBuffer(u.XXX_UnionData[:])
+       buf := codec.NewBuffer(u.XXX_UnionData[:])
        copy(a[:], buf.DecodeBytes(16))
        return
 }