github.com/networkservicemesh/govpp@v0.0.0-20240328101142-8a444680fbba/binapi/nat64/nat64.ba.go (about)

     1  // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
     2  // versions:
     3  //  binapi-generator: v0.10.0-dev
     4  //  VPP:              23.10-rc0~170-g6f1548434
     5  // source: plugins/nat64.api.json
     6  
     7  // Package nat64 contains generated bindings for API file nat64.api.
     8  //
     9  // Contents:
    10  // - 26 messages
    11  package nat64
    12  
    13  import (
    14  	interface_types "github.com/networkservicemesh/govpp/binapi/interface_types"
    15  	ip_types "github.com/networkservicemesh/govpp/binapi/ip_types"
    16  	nat_types "github.com/networkservicemesh/govpp/binapi/nat_types"
    17  	api "go.fd.io/govpp/api"
    18  	codec "go.fd.io/govpp/codec"
    19  )
    20  
    21  // This is a compile-time assertion to ensure that this generated file
    22  // is compatible with the GoVPP api package it is being compiled against.
    23  // A compilation error at this line likely means your copy of the
    24  // GoVPP api package needs to be updated.
    25  const _ = api.GoVppAPIPackageIsVersion2
    26  
    27  const (
    28  	APIFile    = "nat64"
    29  	APIVersion = "1.0.0"
    30  	VersionCrc = 0xfbd06e33
    31  )
    32  
    33  // Enable/disable NAT64 feature on the interface
    34  //   - is_add - true if add, false if delete
    35  //   - flags - flag NAT_IS_INSIDE if interface is inside else
    36  //     interface is outside
    37  //   - sw_if_index - index of the interface
    38  //
    39  // Nat64AddDelInterface defines message 'nat64_add_del_interface'.
    40  type Nat64AddDelInterface struct {
    41  	IsAdd     bool                           `binapi:"bool,name=is_add" json:"is_add,omitempty"`
    42  	Flags     nat_types.NatConfigFlags       `binapi:"nat_config_flags,name=flags" json:"flags,omitempty"`
    43  	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
    44  }
    45  
    46  func (m *Nat64AddDelInterface) Reset()               { *m = Nat64AddDelInterface{} }
    47  func (*Nat64AddDelInterface) GetMessageName() string { return "nat64_add_del_interface" }
    48  func (*Nat64AddDelInterface) GetCrcString() string   { return "f3699b83" }
    49  func (*Nat64AddDelInterface) GetMessageType() api.MessageType {
    50  	return api.RequestMessage
    51  }
    52  
    53  func (m *Nat64AddDelInterface) Size() (size int) {
    54  	if m == nil {
    55  		return 0
    56  	}
    57  	size += 1 // m.IsAdd
    58  	size += 1 // m.Flags
    59  	size += 4 // m.SwIfIndex
    60  	return size
    61  }
    62  func (m *Nat64AddDelInterface) Marshal(b []byte) ([]byte, error) {
    63  	if b == nil {
    64  		b = make([]byte, m.Size())
    65  	}
    66  	buf := codec.NewBuffer(b)
    67  	buf.EncodeBool(m.IsAdd)
    68  	buf.EncodeUint8(uint8(m.Flags))
    69  	buf.EncodeUint32(uint32(m.SwIfIndex))
    70  	return buf.Bytes(), nil
    71  }
    72  func (m *Nat64AddDelInterface) Unmarshal(b []byte) error {
    73  	buf := codec.NewBuffer(b)
    74  	m.IsAdd = buf.DecodeBool()
    75  	m.Flags = nat_types.NatConfigFlags(buf.DecodeUint8())
    76  	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
    77  	return nil
    78  }
    79  
    80  // Add/delete NAT64 pool address from specific interfce
    81  //   - is_add - true if add, false if delete
    82  //   - sw_if_index - software index of the interface
    83  //
    84  // Nat64AddDelInterfaceAddr defines message 'nat64_add_del_interface_addr'.
    85  type Nat64AddDelInterfaceAddr struct {
    86  	IsAdd     bool                           `binapi:"bool,name=is_add" json:"is_add,omitempty"`
    87  	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
    88  }
    89  
    90  func (m *Nat64AddDelInterfaceAddr) Reset()               { *m = Nat64AddDelInterfaceAddr{} }
    91  func (*Nat64AddDelInterfaceAddr) GetMessageName() string { return "nat64_add_del_interface_addr" }
    92  func (*Nat64AddDelInterfaceAddr) GetCrcString() string   { return "47d6e753" }
    93  func (*Nat64AddDelInterfaceAddr) GetMessageType() api.MessageType {
    94  	return api.RequestMessage
    95  }
    96  
    97  func (m *Nat64AddDelInterfaceAddr) Size() (size int) {
    98  	if m == nil {
    99  		return 0
   100  	}
   101  	size += 1 // m.IsAdd
   102  	size += 4 // m.SwIfIndex
   103  	return size
   104  }
   105  func (m *Nat64AddDelInterfaceAddr) Marshal(b []byte) ([]byte, error) {
   106  	if b == nil {
   107  		b = make([]byte, m.Size())
   108  	}
   109  	buf := codec.NewBuffer(b)
   110  	buf.EncodeBool(m.IsAdd)
   111  	buf.EncodeUint32(uint32(m.SwIfIndex))
   112  	return buf.Bytes(), nil
   113  }
   114  func (m *Nat64AddDelInterfaceAddr) Unmarshal(b []byte) error {
   115  	buf := codec.NewBuffer(b)
   116  	m.IsAdd = buf.DecodeBool()
   117  	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
   118  	return nil
   119  }
   120  
   121  // Nat64AddDelInterfaceAddrReply defines message 'nat64_add_del_interface_addr_reply'.
   122  type Nat64AddDelInterfaceAddrReply struct {
   123  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
   124  }
   125  
   126  func (m *Nat64AddDelInterfaceAddrReply) Reset() { *m = Nat64AddDelInterfaceAddrReply{} }
   127  func (*Nat64AddDelInterfaceAddrReply) GetMessageName() string {
   128  	return "nat64_add_del_interface_addr_reply"
   129  }
   130  func (*Nat64AddDelInterfaceAddrReply) GetCrcString() string { return "e8d4e804" }
   131  func (*Nat64AddDelInterfaceAddrReply) GetMessageType() api.MessageType {
   132  	return api.ReplyMessage
   133  }
   134  
   135  func (m *Nat64AddDelInterfaceAddrReply) Size() (size int) {
   136  	if m == nil {
   137  		return 0
   138  	}
   139  	size += 4 // m.Retval
   140  	return size
   141  }
   142  func (m *Nat64AddDelInterfaceAddrReply) Marshal(b []byte) ([]byte, error) {
   143  	if b == nil {
   144  		b = make([]byte, m.Size())
   145  	}
   146  	buf := codec.NewBuffer(b)
   147  	buf.EncodeInt32(m.Retval)
   148  	return buf.Bytes(), nil
   149  }
   150  func (m *Nat64AddDelInterfaceAddrReply) Unmarshal(b []byte) error {
   151  	buf := codec.NewBuffer(b)
   152  	m.Retval = buf.DecodeInt32()
   153  	return nil
   154  }
   155  
   156  // Nat64AddDelInterfaceReply defines message 'nat64_add_del_interface_reply'.
   157  type Nat64AddDelInterfaceReply struct {
   158  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
   159  }
   160  
   161  func (m *Nat64AddDelInterfaceReply) Reset()               { *m = Nat64AddDelInterfaceReply{} }
   162  func (*Nat64AddDelInterfaceReply) GetMessageName() string { return "nat64_add_del_interface_reply" }
   163  func (*Nat64AddDelInterfaceReply) GetCrcString() string   { return "e8d4e804" }
   164  func (*Nat64AddDelInterfaceReply) GetMessageType() api.MessageType {
   165  	return api.ReplyMessage
   166  }
   167  
   168  func (m *Nat64AddDelInterfaceReply) Size() (size int) {
   169  	if m == nil {
   170  		return 0
   171  	}
   172  	size += 4 // m.Retval
   173  	return size
   174  }
   175  func (m *Nat64AddDelInterfaceReply) Marshal(b []byte) ([]byte, error) {
   176  	if b == nil {
   177  		b = make([]byte, m.Size())
   178  	}
   179  	buf := codec.NewBuffer(b)
   180  	buf.EncodeInt32(m.Retval)
   181  	return buf.Bytes(), nil
   182  }
   183  func (m *Nat64AddDelInterfaceReply) Unmarshal(b []byte) error {
   184  	buf := codec.NewBuffer(b)
   185  	m.Retval = buf.DecodeInt32()
   186  	return nil
   187  }
   188  
   189  // Add/delete address range to NAT64 pool
   190  //   - start_addr - start IPv4 address of the range
   191  //   - end_addr - end IPv4 address of the range
   192  //   - vrf_id - VRF id of tenant, ~0 means independent of VRF
   193  //   - is_add - true if add, false if delete
   194  //
   195  // Nat64AddDelPoolAddrRange defines message 'nat64_add_del_pool_addr_range'.
   196  type Nat64AddDelPoolAddrRange struct {
   197  	StartAddr ip_types.IP4Address `binapi:"ip4_address,name=start_addr" json:"start_addr,omitempty"`
   198  	EndAddr   ip_types.IP4Address `binapi:"ip4_address,name=end_addr" json:"end_addr,omitempty"`
   199  	VrfID     uint32              `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
   200  	IsAdd     bool                `binapi:"bool,name=is_add" json:"is_add,omitempty"`
   201  }
   202  
   203  func (m *Nat64AddDelPoolAddrRange) Reset()               { *m = Nat64AddDelPoolAddrRange{} }
   204  func (*Nat64AddDelPoolAddrRange) GetMessageName() string { return "nat64_add_del_pool_addr_range" }
   205  func (*Nat64AddDelPoolAddrRange) GetCrcString() string   { return "a3b944e3" }
   206  func (*Nat64AddDelPoolAddrRange) GetMessageType() api.MessageType {
   207  	return api.RequestMessage
   208  }
   209  
   210  func (m *Nat64AddDelPoolAddrRange) Size() (size int) {
   211  	if m == nil {
   212  		return 0
   213  	}
   214  	size += 1 * 4 // m.StartAddr
   215  	size += 1 * 4 // m.EndAddr
   216  	size += 4     // m.VrfID
   217  	size += 1     // m.IsAdd
   218  	return size
   219  }
   220  func (m *Nat64AddDelPoolAddrRange) Marshal(b []byte) ([]byte, error) {
   221  	if b == nil {
   222  		b = make([]byte, m.Size())
   223  	}
   224  	buf := codec.NewBuffer(b)
   225  	buf.EncodeBytes(m.StartAddr[:], 4)
   226  	buf.EncodeBytes(m.EndAddr[:], 4)
   227  	buf.EncodeUint32(m.VrfID)
   228  	buf.EncodeBool(m.IsAdd)
   229  	return buf.Bytes(), nil
   230  }
   231  func (m *Nat64AddDelPoolAddrRange) Unmarshal(b []byte) error {
   232  	buf := codec.NewBuffer(b)
   233  	copy(m.StartAddr[:], buf.DecodeBytes(4))
   234  	copy(m.EndAddr[:], buf.DecodeBytes(4))
   235  	m.VrfID = buf.DecodeUint32()
   236  	m.IsAdd = buf.DecodeBool()
   237  	return nil
   238  }
   239  
   240  // Nat64AddDelPoolAddrRangeReply defines message 'nat64_add_del_pool_addr_range_reply'.
   241  type Nat64AddDelPoolAddrRangeReply struct {
   242  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
   243  }
   244  
   245  func (m *Nat64AddDelPoolAddrRangeReply) Reset() { *m = Nat64AddDelPoolAddrRangeReply{} }
   246  func (*Nat64AddDelPoolAddrRangeReply) GetMessageName() string {
   247  	return "nat64_add_del_pool_addr_range_reply"
   248  }
   249  func (*Nat64AddDelPoolAddrRangeReply) GetCrcString() string { return "e8d4e804" }
   250  func (*Nat64AddDelPoolAddrRangeReply) GetMessageType() api.MessageType {
   251  	return api.ReplyMessage
   252  }
   253  
   254  func (m *Nat64AddDelPoolAddrRangeReply) Size() (size int) {
   255  	if m == nil {
   256  		return 0
   257  	}
   258  	size += 4 // m.Retval
   259  	return size
   260  }
   261  func (m *Nat64AddDelPoolAddrRangeReply) Marshal(b []byte) ([]byte, error) {
   262  	if b == nil {
   263  		b = make([]byte, m.Size())
   264  	}
   265  	buf := codec.NewBuffer(b)
   266  	buf.EncodeInt32(m.Retval)
   267  	return buf.Bytes(), nil
   268  }
   269  func (m *Nat64AddDelPoolAddrRangeReply) Unmarshal(b []byte) error {
   270  	buf := codec.NewBuffer(b)
   271  	m.Retval = buf.DecodeInt32()
   272  	return nil
   273  }
   274  
   275  // Add/del NAT64 prefix
   276  //   - prefix - NAT64 prefix
   277  //   - vrf_id - VRF id of tenant
   278  //   - is_add - true if add, false if delete
   279  //
   280  // Nat64AddDelPrefix defines message 'nat64_add_del_prefix'.
   281  type Nat64AddDelPrefix struct {
   282  	Prefix ip_types.IP6Prefix `binapi:"ip6_prefix,name=prefix" json:"prefix,omitempty"`
   283  	VrfID  uint32             `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
   284  	IsAdd  bool               `binapi:"bool,name=is_add" json:"is_add,omitempty"`
   285  }
   286  
   287  func (m *Nat64AddDelPrefix) Reset()               { *m = Nat64AddDelPrefix{} }
   288  func (*Nat64AddDelPrefix) GetMessageName() string { return "nat64_add_del_prefix" }
   289  func (*Nat64AddDelPrefix) GetCrcString() string   { return "727b2f4c" }
   290  func (*Nat64AddDelPrefix) GetMessageType() api.MessageType {
   291  	return api.RequestMessage
   292  }
   293  
   294  func (m *Nat64AddDelPrefix) Size() (size int) {
   295  	if m == nil {
   296  		return 0
   297  	}
   298  	size += 1 * 16 // m.Prefix.Address
   299  	size += 1      // m.Prefix.Len
   300  	size += 4      // m.VrfID
   301  	size += 1      // m.IsAdd
   302  	return size
   303  }
   304  func (m *Nat64AddDelPrefix) Marshal(b []byte) ([]byte, error) {
   305  	if b == nil {
   306  		b = make([]byte, m.Size())
   307  	}
   308  	buf := codec.NewBuffer(b)
   309  	buf.EncodeBytes(m.Prefix.Address[:], 16)
   310  	buf.EncodeUint8(m.Prefix.Len)
   311  	buf.EncodeUint32(m.VrfID)
   312  	buf.EncodeBool(m.IsAdd)
   313  	return buf.Bytes(), nil
   314  }
   315  func (m *Nat64AddDelPrefix) Unmarshal(b []byte) error {
   316  	buf := codec.NewBuffer(b)
   317  	copy(m.Prefix.Address[:], buf.DecodeBytes(16))
   318  	m.Prefix.Len = buf.DecodeUint8()
   319  	m.VrfID = buf.DecodeUint32()
   320  	m.IsAdd = buf.DecodeBool()
   321  	return nil
   322  }
   323  
   324  // Nat64AddDelPrefixReply defines message 'nat64_add_del_prefix_reply'.
   325  type Nat64AddDelPrefixReply struct {
   326  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
   327  }
   328  
   329  func (m *Nat64AddDelPrefixReply) Reset()               { *m = Nat64AddDelPrefixReply{} }
   330  func (*Nat64AddDelPrefixReply) GetMessageName() string { return "nat64_add_del_prefix_reply" }
   331  func (*Nat64AddDelPrefixReply) GetCrcString() string   { return "e8d4e804" }
   332  func (*Nat64AddDelPrefixReply) GetMessageType() api.MessageType {
   333  	return api.ReplyMessage
   334  }
   335  
   336  func (m *Nat64AddDelPrefixReply) Size() (size int) {
   337  	if m == nil {
   338  		return 0
   339  	}
   340  	size += 4 // m.Retval
   341  	return size
   342  }
   343  func (m *Nat64AddDelPrefixReply) Marshal(b []byte) ([]byte, error) {
   344  	if b == nil {
   345  		b = make([]byte, m.Size())
   346  	}
   347  	buf := codec.NewBuffer(b)
   348  	buf.EncodeInt32(m.Retval)
   349  	return buf.Bytes(), nil
   350  }
   351  func (m *Nat64AddDelPrefixReply) Unmarshal(b []byte) error {
   352  	buf := codec.NewBuffer(b)
   353  	m.Retval = buf.DecodeInt32()
   354  	return nil
   355  }
   356  
   357  // Add/delete NAT64 static BIB entry
   358  //   - i_addr - inside IPv6 address
   359  //   - o_addr - outside IPv4 address
   360  //   - i_port - inside port number
   361  //   - o_port - outside port number
   362  //   - vrf_id - VRF id of tenant
   363  //   - proto - protocol number
   364  //   - is_add - true if add, false if delete
   365  //
   366  // Nat64AddDelStaticBib defines message 'nat64_add_del_static_bib'.
   367  type Nat64AddDelStaticBib struct {
   368  	IAddr ip_types.IP6Address `binapi:"ip6_address,name=i_addr" json:"i_addr,omitempty"`
   369  	OAddr ip_types.IP4Address `binapi:"ip4_address,name=o_addr" json:"o_addr,omitempty"`
   370  	IPort uint16              `binapi:"u16,name=i_port" json:"i_port,omitempty"`
   371  	OPort uint16              `binapi:"u16,name=o_port" json:"o_port,omitempty"`
   372  	VrfID uint32              `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
   373  	Proto uint8               `binapi:"u8,name=proto" json:"proto,omitempty"`
   374  	IsAdd bool                `binapi:"bool,name=is_add" json:"is_add,omitempty"`
   375  }
   376  
   377  func (m *Nat64AddDelStaticBib) Reset()               { *m = Nat64AddDelStaticBib{} }
   378  func (*Nat64AddDelStaticBib) GetMessageName() string { return "nat64_add_del_static_bib" }
   379  func (*Nat64AddDelStaticBib) GetCrcString() string   { return "1c404de5" }
   380  func (*Nat64AddDelStaticBib) GetMessageType() api.MessageType {
   381  	return api.RequestMessage
   382  }
   383  
   384  func (m *Nat64AddDelStaticBib) Size() (size int) {
   385  	if m == nil {
   386  		return 0
   387  	}
   388  	size += 1 * 16 // m.IAddr
   389  	size += 1 * 4  // m.OAddr
   390  	size += 2      // m.IPort
   391  	size += 2      // m.OPort
   392  	size += 4      // m.VrfID
   393  	size += 1      // m.Proto
   394  	size += 1      // m.IsAdd
   395  	return size
   396  }
   397  func (m *Nat64AddDelStaticBib) Marshal(b []byte) ([]byte, error) {
   398  	if b == nil {
   399  		b = make([]byte, m.Size())
   400  	}
   401  	buf := codec.NewBuffer(b)
   402  	buf.EncodeBytes(m.IAddr[:], 16)
   403  	buf.EncodeBytes(m.OAddr[:], 4)
   404  	buf.EncodeUint16(m.IPort)
   405  	buf.EncodeUint16(m.OPort)
   406  	buf.EncodeUint32(m.VrfID)
   407  	buf.EncodeUint8(m.Proto)
   408  	buf.EncodeBool(m.IsAdd)
   409  	return buf.Bytes(), nil
   410  }
   411  func (m *Nat64AddDelStaticBib) Unmarshal(b []byte) error {
   412  	buf := codec.NewBuffer(b)
   413  	copy(m.IAddr[:], buf.DecodeBytes(16))
   414  	copy(m.OAddr[:], buf.DecodeBytes(4))
   415  	m.IPort = buf.DecodeUint16()
   416  	m.OPort = buf.DecodeUint16()
   417  	m.VrfID = buf.DecodeUint32()
   418  	m.Proto = buf.DecodeUint8()
   419  	m.IsAdd = buf.DecodeBool()
   420  	return nil
   421  }
   422  
   423  // Nat64AddDelStaticBibReply defines message 'nat64_add_del_static_bib_reply'.
   424  type Nat64AddDelStaticBibReply struct {
   425  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
   426  }
   427  
   428  func (m *Nat64AddDelStaticBibReply) Reset()               { *m = Nat64AddDelStaticBibReply{} }
   429  func (*Nat64AddDelStaticBibReply) GetMessageName() string { return "nat64_add_del_static_bib_reply" }
   430  func (*Nat64AddDelStaticBibReply) GetCrcString() string   { return "e8d4e804" }
   431  func (*Nat64AddDelStaticBibReply) GetMessageType() api.MessageType {
   432  	return api.ReplyMessage
   433  }
   434  
   435  func (m *Nat64AddDelStaticBibReply) Size() (size int) {
   436  	if m == nil {
   437  		return 0
   438  	}
   439  	size += 4 // m.Retval
   440  	return size
   441  }
   442  func (m *Nat64AddDelStaticBibReply) Marshal(b []byte) ([]byte, error) {
   443  	if b == nil {
   444  		b = make([]byte, m.Size())
   445  	}
   446  	buf := codec.NewBuffer(b)
   447  	buf.EncodeInt32(m.Retval)
   448  	return buf.Bytes(), nil
   449  }
   450  func (m *Nat64AddDelStaticBibReply) Unmarshal(b []byte) error {
   451  	buf := codec.NewBuffer(b)
   452  	m.Retval = buf.DecodeInt32()
   453  	return nil
   454  }
   455  
   456  // NAT64 BIB details response
   457  //   - i_addr - inside IPv6 address
   458  //   - o_addr - outside IPv4 address
   459  //   - i_port - inside port number
   460  //   - o_port - outside port number
   461  //   - vrf_id - VRF id of tenant
   462  //   - proto - protocol number
   463  //   - flags - flag NAT_IS_STATIC if BIB entry is static
   464  //     or BIB entry is dynamic
   465  //   - ses_num - number of sessions associated with the BIB entry
   466  //
   467  // Nat64BibDetails defines message 'nat64_bib_details'.
   468  type Nat64BibDetails struct {
   469  	IAddr  ip_types.IP6Address      `binapi:"ip6_address,name=i_addr" json:"i_addr,omitempty"`
   470  	OAddr  ip_types.IP4Address      `binapi:"ip4_address,name=o_addr" json:"o_addr,omitempty"`
   471  	IPort  uint16                   `binapi:"u16,name=i_port" json:"i_port,omitempty"`
   472  	OPort  uint16                   `binapi:"u16,name=o_port" json:"o_port,omitempty"`
   473  	VrfID  uint32                   `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
   474  	Proto  uint8                    `binapi:"u8,name=proto" json:"proto,omitempty"`
   475  	Flags  nat_types.NatConfigFlags `binapi:"nat_config_flags,name=flags" json:"flags,omitempty"`
   476  	SesNum uint32                   `binapi:"u32,name=ses_num" json:"ses_num,omitempty"`
   477  }
   478  
   479  func (m *Nat64BibDetails) Reset()               { *m = Nat64BibDetails{} }
   480  func (*Nat64BibDetails) GetMessageName() string { return "nat64_bib_details" }
   481  func (*Nat64BibDetails) GetCrcString() string   { return "43bc3ddf" }
   482  func (*Nat64BibDetails) GetMessageType() api.MessageType {
   483  	return api.ReplyMessage
   484  }
   485  
   486  func (m *Nat64BibDetails) Size() (size int) {
   487  	if m == nil {
   488  		return 0
   489  	}
   490  	size += 1 * 16 // m.IAddr
   491  	size += 1 * 4  // m.OAddr
   492  	size += 2      // m.IPort
   493  	size += 2      // m.OPort
   494  	size += 4      // m.VrfID
   495  	size += 1      // m.Proto
   496  	size += 1      // m.Flags
   497  	size += 4      // m.SesNum
   498  	return size
   499  }
   500  func (m *Nat64BibDetails) Marshal(b []byte) ([]byte, error) {
   501  	if b == nil {
   502  		b = make([]byte, m.Size())
   503  	}
   504  	buf := codec.NewBuffer(b)
   505  	buf.EncodeBytes(m.IAddr[:], 16)
   506  	buf.EncodeBytes(m.OAddr[:], 4)
   507  	buf.EncodeUint16(m.IPort)
   508  	buf.EncodeUint16(m.OPort)
   509  	buf.EncodeUint32(m.VrfID)
   510  	buf.EncodeUint8(m.Proto)
   511  	buf.EncodeUint8(uint8(m.Flags))
   512  	buf.EncodeUint32(m.SesNum)
   513  	return buf.Bytes(), nil
   514  }
   515  func (m *Nat64BibDetails) Unmarshal(b []byte) error {
   516  	buf := codec.NewBuffer(b)
   517  	copy(m.IAddr[:], buf.DecodeBytes(16))
   518  	copy(m.OAddr[:], buf.DecodeBytes(4))
   519  	m.IPort = buf.DecodeUint16()
   520  	m.OPort = buf.DecodeUint16()
   521  	m.VrfID = buf.DecodeUint32()
   522  	m.Proto = buf.DecodeUint8()
   523  	m.Flags = nat_types.NatConfigFlags(buf.DecodeUint8())
   524  	m.SesNum = buf.DecodeUint32()
   525  	return nil
   526  }
   527  
   528  // Dump NAT64 BIB
   529  //   - proto - protocol of the BIB: 255 - all BIBs
   530  //     6 - TCP BIB
   531  //     17 - UDP BIB
   532  //     1/58 - ICMP BIB
   533  //     otherwise - "unknown" protocol BIB
   534  //
   535  // Nat64BibDump defines message 'nat64_bib_dump'.
   536  type Nat64BibDump struct {
   537  	Proto uint8 `binapi:"u8,name=proto" json:"proto,omitempty"`
   538  }
   539  
   540  func (m *Nat64BibDump) Reset()               { *m = Nat64BibDump{} }
   541  func (*Nat64BibDump) GetMessageName() string { return "nat64_bib_dump" }
   542  func (*Nat64BibDump) GetCrcString() string   { return "cfcb6b75" }
   543  func (*Nat64BibDump) GetMessageType() api.MessageType {
   544  	return api.RequestMessage
   545  }
   546  
   547  func (m *Nat64BibDump) Size() (size int) {
   548  	if m == nil {
   549  		return 0
   550  	}
   551  	size += 1 // m.Proto
   552  	return size
   553  }
   554  func (m *Nat64BibDump) Marshal(b []byte) ([]byte, error) {
   555  	if b == nil {
   556  		b = make([]byte, m.Size())
   557  	}
   558  	buf := codec.NewBuffer(b)
   559  	buf.EncodeUint8(m.Proto)
   560  	return buf.Bytes(), nil
   561  }
   562  func (m *Nat64BibDump) Unmarshal(b []byte) error {
   563  	buf := codec.NewBuffer(b)
   564  	m.Proto = buf.DecodeUint8()
   565  	return nil
   566  }
   567  
   568  // Get values of timeouts for NAT64 sessions (seconds)
   569  // Nat64GetTimeouts defines message 'nat64_get_timeouts'.
   570  type Nat64GetTimeouts struct{}
   571  
   572  func (m *Nat64GetTimeouts) Reset()               { *m = Nat64GetTimeouts{} }
   573  func (*Nat64GetTimeouts) GetMessageName() string { return "nat64_get_timeouts" }
   574  func (*Nat64GetTimeouts) GetCrcString() string   { return "51077d14" }
   575  func (*Nat64GetTimeouts) GetMessageType() api.MessageType {
   576  	return api.RequestMessage
   577  }
   578  
   579  func (m *Nat64GetTimeouts) Size() (size int) {
   580  	if m == nil {
   581  		return 0
   582  	}
   583  	return size
   584  }
   585  func (m *Nat64GetTimeouts) Marshal(b []byte) ([]byte, error) {
   586  	if b == nil {
   587  		b = make([]byte, m.Size())
   588  	}
   589  	buf := codec.NewBuffer(b)
   590  	return buf.Bytes(), nil
   591  }
   592  func (m *Nat64GetTimeouts) Unmarshal(b []byte) error {
   593  	return nil
   594  }
   595  
   596  // Get values of timeouts for NAT64 sessions reply
   597  //   - retval - return code
   598  //   - udp - UDP timeout
   599  //   - tcp_established - TCP established timeout
   600  //   - tcp_transitory - TCP transitory timeout
   601  //   - icmp - ICMP timeout
   602  //
   603  // Nat64GetTimeoutsReply defines message 'nat64_get_timeouts_reply'.
   604  type Nat64GetTimeoutsReply struct {
   605  	Retval         int32  `binapi:"i32,name=retval" json:"retval,omitempty"`
   606  	UDP            uint32 `binapi:"u32,name=udp" json:"udp,omitempty"`
   607  	TCPEstablished uint32 `binapi:"u32,name=tcp_established" json:"tcp_established,omitempty"`
   608  	TCPTransitory  uint32 `binapi:"u32,name=tcp_transitory" json:"tcp_transitory,omitempty"`
   609  	ICMP           uint32 `binapi:"u32,name=icmp" json:"icmp,omitempty"`
   610  }
   611  
   612  func (m *Nat64GetTimeoutsReply) Reset()               { *m = Nat64GetTimeoutsReply{} }
   613  func (*Nat64GetTimeoutsReply) GetMessageName() string { return "nat64_get_timeouts_reply" }
   614  func (*Nat64GetTimeoutsReply) GetCrcString() string   { return "3c4df4e1" }
   615  func (*Nat64GetTimeoutsReply) GetMessageType() api.MessageType {
   616  	return api.ReplyMessage
   617  }
   618  
   619  func (m *Nat64GetTimeoutsReply) Size() (size int) {
   620  	if m == nil {
   621  		return 0
   622  	}
   623  	size += 4 // m.Retval
   624  	size += 4 // m.UDP
   625  	size += 4 // m.TCPEstablished
   626  	size += 4 // m.TCPTransitory
   627  	size += 4 // m.ICMP
   628  	return size
   629  }
   630  func (m *Nat64GetTimeoutsReply) Marshal(b []byte) ([]byte, error) {
   631  	if b == nil {
   632  		b = make([]byte, m.Size())
   633  	}
   634  	buf := codec.NewBuffer(b)
   635  	buf.EncodeInt32(m.Retval)
   636  	buf.EncodeUint32(m.UDP)
   637  	buf.EncodeUint32(m.TCPEstablished)
   638  	buf.EncodeUint32(m.TCPTransitory)
   639  	buf.EncodeUint32(m.ICMP)
   640  	return buf.Bytes(), nil
   641  }
   642  func (m *Nat64GetTimeoutsReply) Unmarshal(b []byte) error {
   643  	buf := codec.NewBuffer(b)
   644  	m.Retval = buf.DecodeInt32()
   645  	m.UDP = buf.DecodeUint32()
   646  	m.TCPEstablished = buf.DecodeUint32()
   647  	m.TCPTransitory = buf.DecodeUint32()
   648  	m.ICMP = buf.DecodeUint32()
   649  	return nil
   650  }
   651  
   652  // NAT64 interface details response
   653  //   - flags - flag NAT_IS_INSIDE if interface is inside,
   654  //     flag NAT_IS_OUTSIDE if interface is outside
   655  //     and if both flags are set the interface is
   656  //     both inside and outside
   657  //   - sw_if_index - index of the interface
   658  //
   659  // Nat64InterfaceDetails defines message 'nat64_interface_details'.
   660  type Nat64InterfaceDetails struct {
   661  	Flags     nat_types.NatConfigFlags       `binapi:"nat_config_flags,name=flags" json:"flags,omitempty"`
   662  	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
   663  }
   664  
   665  func (m *Nat64InterfaceDetails) Reset()               { *m = Nat64InterfaceDetails{} }
   666  func (*Nat64InterfaceDetails) GetMessageName() string { return "nat64_interface_details" }
   667  func (*Nat64InterfaceDetails) GetCrcString() string   { return "5d286289" }
   668  func (*Nat64InterfaceDetails) GetMessageType() api.MessageType {
   669  	return api.ReplyMessage
   670  }
   671  
   672  func (m *Nat64InterfaceDetails) Size() (size int) {
   673  	if m == nil {
   674  		return 0
   675  	}
   676  	size += 1 // m.Flags
   677  	size += 4 // m.SwIfIndex
   678  	return size
   679  }
   680  func (m *Nat64InterfaceDetails) Marshal(b []byte) ([]byte, error) {
   681  	if b == nil {
   682  		b = make([]byte, m.Size())
   683  	}
   684  	buf := codec.NewBuffer(b)
   685  	buf.EncodeUint8(uint8(m.Flags))
   686  	buf.EncodeUint32(uint32(m.SwIfIndex))
   687  	return buf.Bytes(), nil
   688  }
   689  func (m *Nat64InterfaceDetails) Unmarshal(b []byte) error {
   690  	buf := codec.NewBuffer(b)
   691  	m.Flags = nat_types.NatConfigFlags(buf.DecodeUint8())
   692  	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
   693  	return nil
   694  }
   695  
   696  // Dump interfaces with NAT64 feature
   697  // Nat64InterfaceDump defines message 'nat64_interface_dump'.
   698  type Nat64InterfaceDump struct{}
   699  
   700  func (m *Nat64InterfaceDump) Reset()               { *m = Nat64InterfaceDump{} }
   701  func (*Nat64InterfaceDump) GetMessageName() string { return "nat64_interface_dump" }
   702  func (*Nat64InterfaceDump) GetCrcString() string   { return "51077d14" }
   703  func (*Nat64InterfaceDump) GetMessageType() api.MessageType {
   704  	return api.RequestMessage
   705  }
   706  
   707  func (m *Nat64InterfaceDump) Size() (size int) {
   708  	if m == nil {
   709  		return 0
   710  	}
   711  	return size
   712  }
   713  func (m *Nat64InterfaceDump) Marshal(b []byte) ([]byte, error) {
   714  	if b == nil {
   715  		b = make([]byte, m.Size())
   716  	}
   717  	buf := codec.NewBuffer(b)
   718  	return buf.Bytes(), nil
   719  }
   720  func (m *Nat64InterfaceDump) Unmarshal(b []byte) error {
   721  	return nil
   722  }
   723  
   724  // Enable/disable NAT64 plugin
   725  //   - bib_buckets - Number of BIB hash buckets
   726  //   - bib_memory_size - Memory size of BIB hash
   727  //   - st_buckets - Number of session table hash buckets
   728  //   - st_memory_size - Memory size of session table hash
   729  //   - enable - true if enable, false if disable
   730  //
   731  // Nat64PluginEnableDisable defines message 'nat64_plugin_enable_disable'.
   732  // InProgress: the message form may change in the future versions
   733  type Nat64PluginEnableDisable struct {
   734  	BibBuckets    uint32 `binapi:"u32,name=bib_buckets" json:"bib_buckets,omitempty"`
   735  	BibMemorySize uint32 `binapi:"u32,name=bib_memory_size" json:"bib_memory_size,omitempty"`
   736  	StBuckets     uint32 `binapi:"u32,name=st_buckets" json:"st_buckets,omitempty"`
   737  	StMemorySize  uint32 `binapi:"u32,name=st_memory_size" json:"st_memory_size,omitempty"`
   738  	Enable        bool   `binapi:"bool,name=enable" json:"enable,omitempty"`
   739  }
   740  
   741  func (m *Nat64PluginEnableDisable) Reset()               { *m = Nat64PluginEnableDisable{} }
   742  func (*Nat64PluginEnableDisable) GetMessageName() string { return "nat64_plugin_enable_disable" }
   743  func (*Nat64PluginEnableDisable) GetCrcString() string   { return "45948b90" }
   744  func (*Nat64PluginEnableDisable) GetMessageType() api.MessageType {
   745  	return api.RequestMessage
   746  }
   747  
   748  func (m *Nat64PluginEnableDisable) Size() (size int) {
   749  	if m == nil {
   750  		return 0
   751  	}
   752  	size += 4 // m.BibBuckets
   753  	size += 4 // m.BibMemorySize
   754  	size += 4 // m.StBuckets
   755  	size += 4 // m.StMemorySize
   756  	size += 1 // m.Enable
   757  	return size
   758  }
   759  func (m *Nat64PluginEnableDisable) Marshal(b []byte) ([]byte, error) {
   760  	if b == nil {
   761  		b = make([]byte, m.Size())
   762  	}
   763  	buf := codec.NewBuffer(b)
   764  	buf.EncodeUint32(m.BibBuckets)
   765  	buf.EncodeUint32(m.BibMemorySize)
   766  	buf.EncodeUint32(m.StBuckets)
   767  	buf.EncodeUint32(m.StMemorySize)
   768  	buf.EncodeBool(m.Enable)
   769  	return buf.Bytes(), nil
   770  }
   771  func (m *Nat64PluginEnableDisable) Unmarshal(b []byte) error {
   772  	buf := codec.NewBuffer(b)
   773  	m.BibBuckets = buf.DecodeUint32()
   774  	m.BibMemorySize = buf.DecodeUint32()
   775  	m.StBuckets = buf.DecodeUint32()
   776  	m.StMemorySize = buf.DecodeUint32()
   777  	m.Enable = buf.DecodeBool()
   778  	return nil
   779  }
   780  
   781  // Nat64PluginEnableDisableReply defines message 'nat64_plugin_enable_disable_reply'.
   782  // InProgress: the message form may change in the future versions
   783  type Nat64PluginEnableDisableReply struct {
   784  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
   785  }
   786  
   787  func (m *Nat64PluginEnableDisableReply) Reset() { *m = Nat64PluginEnableDisableReply{} }
   788  func (*Nat64PluginEnableDisableReply) GetMessageName() string {
   789  	return "nat64_plugin_enable_disable_reply"
   790  }
   791  func (*Nat64PluginEnableDisableReply) GetCrcString() string { return "e8d4e804" }
   792  func (*Nat64PluginEnableDisableReply) GetMessageType() api.MessageType {
   793  	return api.ReplyMessage
   794  }
   795  
   796  func (m *Nat64PluginEnableDisableReply) Size() (size int) {
   797  	if m == nil {
   798  		return 0
   799  	}
   800  	size += 4 // m.Retval
   801  	return size
   802  }
   803  func (m *Nat64PluginEnableDisableReply) Marshal(b []byte) ([]byte, error) {
   804  	if b == nil {
   805  		b = make([]byte, m.Size())
   806  	}
   807  	buf := codec.NewBuffer(b)
   808  	buf.EncodeInt32(m.Retval)
   809  	return buf.Bytes(), nil
   810  }
   811  func (m *Nat64PluginEnableDisableReply) Unmarshal(b []byte) error {
   812  	buf := codec.NewBuffer(b)
   813  	m.Retval = buf.DecodeInt32()
   814  	return nil
   815  }
   816  
   817  // NAT64 pool address details response
   818  //   - address - IPv4 address
   819  //   - vfr_id - VRF id of tenant, ~0 means independent of VRF
   820  //
   821  // Nat64PoolAddrDetails defines message 'nat64_pool_addr_details'.
   822  type Nat64PoolAddrDetails struct {
   823  	Address ip_types.IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
   824  	VrfID   uint32              `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
   825  }
   826  
   827  func (m *Nat64PoolAddrDetails) Reset()               { *m = Nat64PoolAddrDetails{} }
   828  func (*Nat64PoolAddrDetails) GetMessageName() string { return "nat64_pool_addr_details" }
   829  func (*Nat64PoolAddrDetails) GetCrcString() string   { return "9bb99cdb" }
   830  func (*Nat64PoolAddrDetails) GetMessageType() api.MessageType {
   831  	return api.ReplyMessage
   832  }
   833  
   834  func (m *Nat64PoolAddrDetails) Size() (size int) {
   835  	if m == nil {
   836  		return 0
   837  	}
   838  	size += 1 * 4 // m.Address
   839  	size += 4     // m.VrfID
   840  	return size
   841  }
   842  func (m *Nat64PoolAddrDetails) Marshal(b []byte) ([]byte, error) {
   843  	if b == nil {
   844  		b = make([]byte, m.Size())
   845  	}
   846  	buf := codec.NewBuffer(b)
   847  	buf.EncodeBytes(m.Address[:], 4)
   848  	buf.EncodeUint32(m.VrfID)
   849  	return buf.Bytes(), nil
   850  }
   851  func (m *Nat64PoolAddrDetails) Unmarshal(b []byte) error {
   852  	buf := codec.NewBuffer(b)
   853  	copy(m.Address[:], buf.DecodeBytes(4))
   854  	m.VrfID = buf.DecodeUint32()
   855  	return nil
   856  }
   857  
   858  // Dump NAT64 pool addresses
   859  // Nat64PoolAddrDump defines message 'nat64_pool_addr_dump'.
   860  type Nat64PoolAddrDump struct{}
   861  
   862  func (m *Nat64PoolAddrDump) Reset()               { *m = Nat64PoolAddrDump{} }
   863  func (*Nat64PoolAddrDump) GetMessageName() string { return "nat64_pool_addr_dump" }
   864  func (*Nat64PoolAddrDump) GetCrcString() string   { return "51077d14" }
   865  func (*Nat64PoolAddrDump) GetMessageType() api.MessageType {
   866  	return api.RequestMessage
   867  }
   868  
   869  func (m *Nat64PoolAddrDump) Size() (size int) {
   870  	if m == nil {
   871  		return 0
   872  	}
   873  	return size
   874  }
   875  func (m *Nat64PoolAddrDump) Marshal(b []byte) ([]byte, error) {
   876  	if b == nil {
   877  		b = make([]byte, m.Size())
   878  	}
   879  	buf := codec.NewBuffer(b)
   880  	return buf.Bytes(), nil
   881  }
   882  func (m *Nat64PoolAddrDump) Unmarshal(b []byte) error {
   883  	return nil
   884  }
   885  
   886  // Dump NAT64 prefix details response
   887  //   - prefix - NAT64 prefix
   888  //   - vrf_id - VRF id of tenant
   889  //
   890  // Nat64PrefixDetails defines message 'nat64_prefix_details'.
   891  type Nat64PrefixDetails struct {
   892  	Prefix ip_types.IP6Prefix `binapi:"ip6_prefix,name=prefix" json:"prefix,omitempty"`
   893  	VrfID  uint32             `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
   894  }
   895  
   896  func (m *Nat64PrefixDetails) Reset()               { *m = Nat64PrefixDetails{} }
   897  func (*Nat64PrefixDetails) GetMessageName() string { return "nat64_prefix_details" }
   898  func (*Nat64PrefixDetails) GetCrcString() string   { return "20568de3" }
   899  func (*Nat64PrefixDetails) GetMessageType() api.MessageType {
   900  	return api.ReplyMessage
   901  }
   902  
   903  func (m *Nat64PrefixDetails) Size() (size int) {
   904  	if m == nil {
   905  		return 0
   906  	}
   907  	size += 1 * 16 // m.Prefix.Address
   908  	size += 1      // m.Prefix.Len
   909  	size += 4      // m.VrfID
   910  	return size
   911  }
   912  func (m *Nat64PrefixDetails) Marshal(b []byte) ([]byte, error) {
   913  	if b == nil {
   914  		b = make([]byte, m.Size())
   915  	}
   916  	buf := codec.NewBuffer(b)
   917  	buf.EncodeBytes(m.Prefix.Address[:], 16)
   918  	buf.EncodeUint8(m.Prefix.Len)
   919  	buf.EncodeUint32(m.VrfID)
   920  	return buf.Bytes(), nil
   921  }
   922  func (m *Nat64PrefixDetails) Unmarshal(b []byte) error {
   923  	buf := codec.NewBuffer(b)
   924  	copy(m.Prefix.Address[:], buf.DecodeBytes(16))
   925  	m.Prefix.Len = buf.DecodeUint8()
   926  	m.VrfID = buf.DecodeUint32()
   927  	return nil
   928  }
   929  
   930  // Dump NAT64 prefix
   931  // Nat64PrefixDump defines message 'nat64_prefix_dump'.
   932  type Nat64PrefixDump struct{}
   933  
   934  func (m *Nat64PrefixDump) Reset()               { *m = Nat64PrefixDump{} }
   935  func (*Nat64PrefixDump) GetMessageName() string { return "nat64_prefix_dump" }
   936  func (*Nat64PrefixDump) GetCrcString() string   { return "51077d14" }
   937  func (*Nat64PrefixDump) GetMessageType() api.MessageType {
   938  	return api.RequestMessage
   939  }
   940  
   941  func (m *Nat64PrefixDump) Size() (size int) {
   942  	if m == nil {
   943  		return 0
   944  	}
   945  	return size
   946  }
   947  func (m *Nat64PrefixDump) Marshal(b []byte) ([]byte, error) {
   948  	if b == nil {
   949  		b = make([]byte, m.Size())
   950  	}
   951  	buf := codec.NewBuffer(b)
   952  	return buf.Bytes(), nil
   953  }
   954  func (m *Nat64PrefixDump) Unmarshal(b []byte) error {
   955  	return nil
   956  }
   957  
   958  // Set values of timeouts for NAT64 sessions (seconds)
   959  //   - udp - UDP timeout (default 300sec)
   960  //   - tcp_established - TCP established timeout (default 7440sec)
   961  //   - tcp_transitory - TCP transitory timeout (default 240sec)
   962  //   - icmp - ICMP timeout (default 60sec)
   963  //
   964  // Nat64SetTimeouts defines message 'nat64_set_timeouts'.
   965  type Nat64SetTimeouts struct {
   966  	UDP            uint32 `binapi:"u32,name=udp" json:"udp,omitempty"`
   967  	TCPEstablished uint32 `binapi:"u32,name=tcp_established" json:"tcp_established,omitempty"`
   968  	TCPTransitory  uint32 `binapi:"u32,name=tcp_transitory" json:"tcp_transitory,omitempty"`
   969  	ICMP           uint32 `binapi:"u32,name=icmp" json:"icmp,omitempty"`
   970  }
   971  
   972  func (m *Nat64SetTimeouts) Reset()               { *m = Nat64SetTimeouts{} }
   973  func (*Nat64SetTimeouts) GetMessageName() string { return "nat64_set_timeouts" }
   974  func (*Nat64SetTimeouts) GetCrcString() string   { return "d4746b16" }
   975  func (*Nat64SetTimeouts) GetMessageType() api.MessageType {
   976  	return api.RequestMessage
   977  }
   978  
   979  func (m *Nat64SetTimeouts) Size() (size int) {
   980  	if m == nil {
   981  		return 0
   982  	}
   983  	size += 4 // m.UDP
   984  	size += 4 // m.TCPEstablished
   985  	size += 4 // m.TCPTransitory
   986  	size += 4 // m.ICMP
   987  	return size
   988  }
   989  func (m *Nat64SetTimeouts) Marshal(b []byte) ([]byte, error) {
   990  	if b == nil {
   991  		b = make([]byte, m.Size())
   992  	}
   993  	buf := codec.NewBuffer(b)
   994  	buf.EncodeUint32(m.UDP)
   995  	buf.EncodeUint32(m.TCPEstablished)
   996  	buf.EncodeUint32(m.TCPTransitory)
   997  	buf.EncodeUint32(m.ICMP)
   998  	return buf.Bytes(), nil
   999  }
  1000  func (m *Nat64SetTimeouts) Unmarshal(b []byte) error {
  1001  	buf := codec.NewBuffer(b)
  1002  	m.UDP = buf.DecodeUint32()
  1003  	m.TCPEstablished = buf.DecodeUint32()
  1004  	m.TCPTransitory = buf.DecodeUint32()
  1005  	m.ICMP = buf.DecodeUint32()
  1006  	return nil
  1007  }
  1008  
  1009  // Nat64SetTimeoutsReply defines message 'nat64_set_timeouts_reply'.
  1010  type Nat64SetTimeoutsReply struct {
  1011  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
  1012  }
  1013  
  1014  func (m *Nat64SetTimeoutsReply) Reset()               { *m = Nat64SetTimeoutsReply{} }
  1015  func (*Nat64SetTimeoutsReply) GetMessageName() string { return "nat64_set_timeouts_reply" }
  1016  func (*Nat64SetTimeoutsReply) GetCrcString() string   { return "e8d4e804" }
  1017  func (*Nat64SetTimeoutsReply) GetMessageType() api.MessageType {
  1018  	return api.ReplyMessage
  1019  }
  1020  
  1021  func (m *Nat64SetTimeoutsReply) Size() (size int) {
  1022  	if m == nil {
  1023  		return 0
  1024  	}
  1025  	size += 4 // m.Retval
  1026  	return size
  1027  }
  1028  func (m *Nat64SetTimeoutsReply) Marshal(b []byte) ([]byte, error) {
  1029  	if b == nil {
  1030  		b = make([]byte, m.Size())
  1031  	}
  1032  	buf := codec.NewBuffer(b)
  1033  	buf.EncodeInt32(m.Retval)
  1034  	return buf.Bytes(), nil
  1035  }
  1036  func (m *Nat64SetTimeoutsReply) Unmarshal(b []byte) error {
  1037  	buf := codec.NewBuffer(b)
  1038  	m.Retval = buf.DecodeInt32()
  1039  	return nil
  1040  }
  1041  
  1042  // NAT64 session table details response
  1043  //   - il_addr - inside IPv6 address of the local host
  1044  //   - ol_addr - outside IPv4 address of the local host
  1045  //   - il_port - inside port number id of the local host/inside ICMP id
  1046  //   - ol_port - outside port number of the local host/outside ICMP id
  1047  //   - ir_addr - inside IPv6 address of the remote host
  1048  //   - or_addr - outside IPv4 address of the remote host
  1049  //   - r_port - port number of the remote host (not used for ICMP)
  1050  //   - vrf_id - VRF id of tenant
  1051  //   - proto - protocol number
  1052  //
  1053  // Nat64StDetails defines message 'nat64_st_details'.
  1054  type Nat64StDetails struct {
  1055  	IlAddr ip_types.IP6Address `binapi:"ip6_address,name=il_addr" json:"il_addr,omitempty"`
  1056  	OlAddr ip_types.IP4Address `binapi:"ip4_address,name=ol_addr" json:"ol_addr,omitempty"`
  1057  	IlPort uint16              `binapi:"u16,name=il_port" json:"il_port,omitempty"`
  1058  	OlPort uint16              `binapi:"u16,name=ol_port" json:"ol_port,omitempty"`
  1059  	IrAddr ip_types.IP6Address `binapi:"ip6_address,name=ir_addr" json:"ir_addr,omitempty"`
  1060  	OrAddr ip_types.IP4Address `binapi:"ip4_address,name=or_addr" json:"or_addr,omitempty"`
  1061  	RPort  uint16              `binapi:"u16,name=r_port" json:"r_port,omitempty"`
  1062  	VrfID  uint32              `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
  1063  	Proto  uint8               `binapi:"u8,name=proto" json:"proto,omitempty"`
  1064  }
  1065  
  1066  func (m *Nat64StDetails) Reset()               { *m = Nat64StDetails{} }
  1067  func (*Nat64StDetails) GetMessageName() string { return "nat64_st_details" }
  1068  func (*Nat64StDetails) GetCrcString() string   { return "dd3361ed" }
  1069  func (*Nat64StDetails) GetMessageType() api.MessageType {
  1070  	return api.ReplyMessage
  1071  }
  1072  
  1073  func (m *Nat64StDetails) Size() (size int) {
  1074  	if m == nil {
  1075  		return 0
  1076  	}
  1077  	size += 1 * 16 // m.IlAddr
  1078  	size += 1 * 4  // m.OlAddr
  1079  	size += 2      // m.IlPort
  1080  	size += 2      // m.OlPort
  1081  	size += 1 * 16 // m.IrAddr
  1082  	size += 1 * 4  // m.OrAddr
  1083  	size += 2      // m.RPort
  1084  	size += 4      // m.VrfID
  1085  	size += 1      // m.Proto
  1086  	return size
  1087  }
  1088  func (m *Nat64StDetails) Marshal(b []byte) ([]byte, error) {
  1089  	if b == nil {
  1090  		b = make([]byte, m.Size())
  1091  	}
  1092  	buf := codec.NewBuffer(b)
  1093  	buf.EncodeBytes(m.IlAddr[:], 16)
  1094  	buf.EncodeBytes(m.OlAddr[:], 4)
  1095  	buf.EncodeUint16(m.IlPort)
  1096  	buf.EncodeUint16(m.OlPort)
  1097  	buf.EncodeBytes(m.IrAddr[:], 16)
  1098  	buf.EncodeBytes(m.OrAddr[:], 4)
  1099  	buf.EncodeUint16(m.RPort)
  1100  	buf.EncodeUint32(m.VrfID)
  1101  	buf.EncodeUint8(m.Proto)
  1102  	return buf.Bytes(), nil
  1103  }
  1104  func (m *Nat64StDetails) Unmarshal(b []byte) error {
  1105  	buf := codec.NewBuffer(b)
  1106  	copy(m.IlAddr[:], buf.DecodeBytes(16))
  1107  	copy(m.OlAddr[:], buf.DecodeBytes(4))
  1108  	m.IlPort = buf.DecodeUint16()
  1109  	m.OlPort = buf.DecodeUint16()
  1110  	copy(m.IrAddr[:], buf.DecodeBytes(16))
  1111  	copy(m.OrAddr[:], buf.DecodeBytes(4))
  1112  	m.RPort = buf.DecodeUint16()
  1113  	m.VrfID = buf.DecodeUint32()
  1114  	m.Proto = buf.DecodeUint8()
  1115  	return nil
  1116  }
  1117  
  1118  // Dump NAT64 session table
  1119  //   - proto - protocol of the session table: 255 - all STs
  1120  //     6 - TCP ST
  1121  //     17 - UDP ST
  1122  //     1/58 - ICMP ST
  1123  //     otherwise - "unknown" proto ST
  1124  //
  1125  // Nat64StDump defines message 'nat64_st_dump'.
  1126  type Nat64StDump struct {
  1127  	Proto uint8 `binapi:"u8,name=proto" json:"proto,omitempty"`
  1128  }
  1129  
  1130  func (m *Nat64StDump) Reset()               { *m = Nat64StDump{} }
  1131  func (*Nat64StDump) GetMessageName() string { return "nat64_st_dump" }
  1132  func (*Nat64StDump) GetCrcString() string   { return "cfcb6b75" }
  1133  func (*Nat64StDump) GetMessageType() api.MessageType {
  1134  	return api.RequestMessage
  1135  }
  1136  
  1137  func (m *Nat64StDump) Size() (size int) {
  1138  	if m == nil {
  1139  		return 0
  1140  	}
  1141  	size += 1 // m.Proto
  1142  	return size
  1143  }
  1144  func (m *Nat64StDump) Marshal(b []byte) ([]byte, error) {
  1145  	if b == nil {
  1146  		b = make([]byte, m.Size())
  1147  	}
  1148  	buf := codec.NewBuffer(b)
  1149  	buf.EncodeUint8(m.Proto)
  1150  	return buf.Bytes(), nil
  1151  }
  1152  func (m *Nat64StDump) Unmarshal(b []byte) error {
  1153  	buf := codec.NewBuffer(b)
  1154  	m.Proto = buf.DecodeUint8()
  1155  	return nil
  1156  }
  1157  
  1158  func init() { file_nat64_binapi_init() }
  1159  func file_nat64_binapi_init() {
  1160  	api.RegisterMessage((*Nat64AddDelInterface)(nil), "nat64_add_del_interface_f3699b83")
  1161  	api.RegisterMessage((*Nat64AddDelInterfaceAddr)(nil), "nat64_add_del_interface_addr_47d6e753")
  1162  	api.RegisterMessage((*Nat64AddDelInterfaceAddrReply)(nil), "nat64_add_del_interface_addr_reply_e8d4e804")
  1163  	api.RegisterMessage((*Nat64AddDelInterfaceReply)(nil), "nat64_add_del_interface_reply_e8d4e804")
  1164  	api.RegisterMessage((*Nat64AddDelPoolAddrRange)(nil), "nat64_add_del_pool_addr_range_a3b944e3")
  1165  	api.RegisterMessage((*Nat64AddDelPoolAddrRangeReply)(nil), "nat64_add_del_pool_addr_range_reply_e8d4e804")
  1166  	api.RegisterMessage((*Nat64AddDelPrefix)(nil), "nat64_add_del_prefix_727b2f4c")
  1167  	api.RegisterMessage((*Nat64AddDelPrefixReply)(nil), "nat64_add_del_prefix_reply_e8d4e804")
  1168  	api.RegisterMessage((*Nat64AddDelStaticBib)(nil), "nat64_add_del_static_bib_1c404de5")
  1169  	api.RegisterMessage((*Nat64AddDelStaticBibReply)(nil), "nat64_add_del_static_bib_reply_e8d4e804")
  1170  	api.RegisterMessage((*Nat64BibDetails)(nil), "nat64_bib_details_43bc3ddf")
  1171  	api.RegisterMessage((*Nat64BibDump)(nil), "nat64_bib_dump_cfcb6b75")
  1172  	api.RegisterMessage((*Nat64GetTimeouts)(nil), "nat64_get_timeouts_51077d14")
  1173  	api.RegisterMessage((*Nat64GetTimeoutsReply)(nil), "nat64_get_timeouts_reply_3c4df4e1")
  1174  	api.RegisterMessage((*Nat64InterfaceDetails)(nil), "nat64_interface_details_5d286289")
  1175  	api.RegisterMessage((*Nat64InterfaceDump)(nil), "nat64_interface_dump_51077d14")
  1176  	api.RegisterMessage((*Nat64PluginEnableDisable)(nil), "nat64_plugin_enable_disable_45948b90")
  1177  	api.RegisterMessage((*Nat64PluginEnableDisableReply)(nil), "nat64_plugin_enable_disable_reply_e8d4e804")
  1178  	api.RegisterMessage((*Nat64PoolAddrDetails)(nil), "nat64_pool_addr_details_9bb99cdb")
  1179  	api.RegisterMessage((*Nat64PoolAddrDump)(nil), "nat64_pool_addr_dump_51077d14")
  1180  	api.RegisterMessage((*Nat64PrefixDetails)(nil), "nat64_prefix_details_20568de3")
  1181  	api.RegisterMessage((*Nat64PrefixDump)(nil), "nat64_prefix_dump_51077d14")
  1182  	api.RegisterMessage((*Nat64SetTimeouts)(nil), "nat64_set_timeouts_d4746b16")
  1183  	api.RegisterMessage((*Nat64SetTimeoutsReply)(nil), "nat64_set_timeouts_reply_e8d4e804")
  1184  	api.RegisterMessage((*Nat64StDetails)(nil), "nat64_st_details_dd3361ed")
  1185  	api.RegisterMessage((*Nat64StDump)(nil), "nat64_st_dump_cfcb6b75")
  1186  }
  1187  
  1188  // Messages returns list of all messages in this module.
  1189  func AllMessages() []api.Message {
  1190  	return []api.Message{
  1191  		(*Nat64AddDelInterface)(nil),
  1192  		(*Nat64AddDelInterfaceAddr)(nil),
  1193  		(*Nat64AddDelInterfaceAddrReply)(nil),
  1194  		(*Nat64AddDelInterfaceReply)(nil),
  1195  		(*Nat64AddDelPoolAddrRange)(nil),
  1196  		(*Nat64AddDelPoolAddrRangeReply)(nil),
  1197  		(*Nat64AddDelPrefix)(nil),
  1198  		(*Nat64AddDelPrefixReply)(nil),
  1199  		(*Nat64AddDelStaticBib)(nil),
  1200  		(*Nat64AddDelStaticBibReply)(nil),
  1201  		(*Nat64BibDetails)(nil),
  1202  		(*Nat64BibDump)(nil),
  1203  		(*Nat64GetTimeouts)(nil),
  1204  		(*Nat64GetTimeoutsReply)(nil),
  1205  		(*Nat64InterfaceDetails)(nil),
  1206  		(*Nat64InterfaceDump)(nil),
  1207  		(*Nat64PluginEnableDisable)(nil),
  1208  		(*Nat64PluginEnableDisableReply)(nil),
  1209  		(*Nat64PoolAddrDetails)(nil),
  1210  		(*Nat64PoolAddrDump)(nil),
  1211  		(*Nat64PrefixDetails)(nil),
  1212  		(*Nat64PrefixDump)(nil),
  1213  		(*Nat64SetTimeouts)(nil),
  1214  		(*Nat64SetTimeoutsReply)(nil),
  1215  		(*Nat64StDetails)(nil),
  1216  		(*Nat64StDump)(nil),
  1217  	}
  1218  }