github.com/edwarnicke/govpp@v0.0.0-20230130211138-14ef5d20b1d0/binapi/igmp/igmp.ba.go (about)

     1  // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
     2  // versions:
     3  //  binapi-generator: v0.4.0-dev
     4  //  VPP:              23.02-rc0~189-g57127b32a
     5  // source: /usr/share/vpp/api/plugins/igmp.api.json
     6  
     7  // Package igmp contains generated bindings for API file igmp.api.
     8  //
     9  // Contents:
    10  //   2 enums
    11  //   2 structs
    12  //  19 messages
    13  //
    14  package igmp
    15  
    16  import (
    17  	"strconv"
    18  
    19  	api "git.fd.io/govpp.git/api"
    20  	codec "git.fd.io/govpp.git/codec"
    21  	interface_types "github.com/edwarnicke/govpp/binapi/interface_types"
    22  	ip_types "github.com/edwarnicke/govpp/binapi/ip_types"
    23  )
    24  
    25  // This is a compile-time assertion to ensure that this generated file
    26  // is compatible with the GoVPP api package it is being compiled against.
    27  // A compilation error at this line likely means your copy of the
    28  // GoVPP api package needs to be updated.
    29  const _ = api.GoVppAPIPackageIsVersion2
    30  
    31  const (
    32  	APIFile    = "igmp"
    33  	APIVersion = "1.0.0"
    34  	VersionCrc = 0x95a4ff29
    35  )
    36  
    37  // FilterMode defines enum 'filter_mode'.
    38  type FilterMode uint32
    39  
    40  const (
    41  	EXCLUDE FilterMode = 0
    42  	INCLUDE FilterMode = 1
    43  )
    44  
    45  var (
    46  	FilterMode_name = map[uint32]string{
    47  		0: "EXCLUDE",
    48  		1: "INCLUDE",
    49  	}
    50  	FilterMode_value = map[string]uint32{
    51  		"EXCLUDE": 0,
    52  		"INCLUDE": 1,
    53  	}
    54  )
    55  
    56  func (x FilterMode) String() string {
    57  	s, ok := FilterMode_name[uint32(x)]
    58  	if ok {
    59  		return s
    60  	}
    61  	return "FilterMode(" + strconv.Itoa(int(x)) + ")"
    62  }
    63  
    64  // GroupPrefixType defines enum 'group_prefix_type'.
    65  type GroupPrefixType uint32
    66  
    67  const (
    68  	ASM GroupPrefixType = 0
    69  	SSM GroupPrefixType = 1
    70  )
    71  
    72  var (
    73  	GroupPrefixType_name = map[uint32]string{
    74  		0: "ASM",
    75  		1: "SSM",
    76  	}
    77  	GroupPrefixType_value = map[string]uint32{
    78  		"ASM": 0,
    79  		"SSM": 1,
    80  	}
    81  )
    82  
    83  func (x GroupPrefixType) String() string {
    84  	s, ok := GroupPrefixType_name[uint32(x)]
    85  	if ok {
    86  		return s
    87  	}
    88  	return "GroupPrefixType(" + strconv.Itoa(int(x)) + ")"
    89  }
    90  
    91  // GroupPrefix defines type 'group_prefix'.
    92  type GroupPrefix struct {
    93  	Type   GroupPrefixType `binapi:"group_prefix_type,name=type" json:"type,omitempty"`
    94  	Prefix ip_types.Prefix `binapi:"prefix,name=prefix" json:"prefix,omitempty"`
    95  }
    96  
    97  // IgmpGroup defines type 'igmp_group'.
    98  type IgmpGroup struct {
    99  	Filter    FilterMode                     `binapi:"filter_mode,name=filter" json:"filter,omitempty"`
   100  	NSrcs     uint8                          `binapi:"u8,name=n_srcs" json:"-"`
   101  	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
   102  	Gaddr     ip_types.IP4Address            `binapi:"ip4_address,name=gaddr" json:"gaddr,omitempty"`
   103  	Saddrs    []ip_types.IP4Address          `binapi:"ip4_address[n_srcs],name=saddrs" json:"saddrs,omitempty"`
   104  }
   105  
   106  // IgmpClearInterface defines message 'igmp_clear_interface'.
   107  type IgmpClearInterface struct {
   108  	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
   109  }
   110  
   111  func (m *IgmpClearInterface) Reset()               { *m = IgmpClearInterface{} }
   112  func (*IgmpClearInterface) GetMessageName() string { return "igmp_clear_interface" }
   113  func (*IgmpClearInterface) GetCrcString() string   { return "f9e6675e" }
   114  func (*IgmpClearInterface) GetMessageType() api.MessageType {
   115  	return api.RequestMessage
   116  }
   117  
   118  func (m *IgmpClearInterface) Size() (size int) {
   119  	if m == nil {
   120  		return 0
   121  	}
   122  	size += 4 // m.SwIfIndex
   123  	return size
   124  }
   125  func (m *IgmpClearInterface) Marshal(b []byte) ([]byte, error) {
   126  	if b == nil {
   127  		b = make([]byte, m.Size())
   128  	}
   129  	buf := codec.NewBuffer(b)
   130  	buf.EncodeUint32(uint32(m.SwIfIndex))
   131  	return buf.Bytes(), nil
   132  }
   133  func (m *IgmpClearInterface) Unmarshal(b []byte) error {
   134  	buf := codec.NewBuffer(b)
   135  	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
   136  	return nil
   137  }
   138  
   139  // IgmpClearInterfaceReply defines message 'igmp_clear_interface_reply'.
   140  type IgmpClearInterfaceReply struct {
   141  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
   142  }
   143  
   144  func (m *IgmpClearInterfaceReply) Reset()               { *m = IgmpClearInterfaceReply{} }
   145  func (*IgmpClearInterfaceReply) GetMessageName() string { return "igmp_clear_interface_reply" }
   146  func (*IgmpClearInterfaceReply) GetCrcString() string   { return "e8d4e804" }
   147  func (*IgmpClearInterfaceReply) GetMessageType() api.MessageType {
   148  	return api.ReplyMessage
   149  }
   150  
   151  func (m *IgmpClearInterfaceReply) Size() (size int) {
   152  	if m == nil {
   153  		return 0
   154  	}
   155  	size += 4 // m.Retval
   156  	return size
   157  }
   158  func (m *IgmpClearInterfaceReply) Marshal(b []byte) ([]byte, error) {
   159  	if b == nil {
   160  		b = make([]byte, m.Size())
   161  	}
   162  	buf := codec.NewBuffer(b)
   163  	buf.EncodeInt32(m.Retval)
   164  	return buf.Bytes(), nil
   165  }
   166  func (m *IgmpClearInterfaceReply) Unmarshal(b []byte) error {
   167  	buf := codec.NewBuffer(b)
   168  	m.Retval = buf.DecodeInt32()
   169  	return nil
   170  }
   171  
   172  // IgmpDetails defines message 'igmp_details'.
   173  type IgmpDetails struct {
   174  	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
   175  	Saddr     ip_types.IP4Address            `binapi:"ip4_address,name=saddr" json:"saddr,omitempty"`
   176  	Gaddr     ip_types.IP4Address            `binapi:"ip4_address,name=gaddr" json:"gaddr,omitempty"`
   177  }
   178  
   179  func (m *IgmpDetails) Reset()               { *m = IgmpDetails{} }
   180  func (*IgmpDetails) GetMessageName() string { return "igmp_details" }
   181  func (*IgmpDetails) GetCrcString() string   { return "38f09929" }
   182  func (*IgmpDetails) GetMessageType() api.MessageType {
   183  	return api.ReplyMessage
   184  }
   185  
   186  func (m *IgmpDetails) Size() (size int) {
   187  	if m == nil {
   188  		return 0
   189  	}
   190  	size += 4     // m.SwIfIndex
   191  	size += 1 * 4 // m.Saddr
   192  	size += 1 * 4 // m.Gaddr
   193  	return size
   194  }
   195  func (m *IgmpDetails) Marshal(b []byte) ([]byte, error) {
   196  	if b == nil {
   197  		b = make([]byte, m.Size())
   198  	}
   199  	buf := codec.NewBuffer(b)
   200  	buf.EncodeUint32(uint32(m.SwIfIndex))
   201  	buf.EncodeBytes(m.Saddr[:], 4)
   202  	buf.EncodeBytes(m.Gaddr[:], 4)
   203  	return buf.Bytes(), nil
   204  }
   205  func (m *IgmpDetails) Unmarshal(b []byte) error {
   206  	buf := codec.NewBuffer(b)
   207  	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
   208  	copy(m.Saddr[:], buf.DecodeBytes(4))
   209  	copy(m.Gaddr[:], buf.DecodeBytes(4))
   210  	return nil
   211  }
   212  
   213  // IgmpDump defines message 'igmp_dump'.
   214  type IgmpDump struct {
   215  	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
   216  }
   217  
   218  func (m *IgmpDump) Reset()               { *m = IgmpDump{} }
   219  func (*IgmpDump) GetMessageName() string { return "igmp_dump" }
   220  func (*IgmpDump) GetCrcString() string   { return "f9e6675e" }
   221  func (*IgmpDump) GetMessageType() api.MessageType {
   222  	return api.RequestMessage
   223  }
   224  
   225  func (m *IgmpDump) Size() (size int) {
   226  	if m == nil {
   227  		return 0
   228  	}
   229  	size += 4 // m.SwIfIndex
   230  	return size
   231  }
   232  func (m *IgmpDump) Marshal(b []byte) ([]byte, error) {
   233  	if b == nil {
   234  		b = make([]byte, m.Size())
   235  	}
   236  	buf := codec.NewBuffer(b)
   237  	buf.EncodeUint32(uint32(m.SwIfIndex))
   238  	return buf.Bytes(), nil
   239  }
   240  func (m *IgmpDump) Unmarshal(b []byte) error {
   241  	buf := codec.NewBuffer(b)
   242  	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
   243  	return nil
   244  }
   245  
   246  // IgmpEnableDisable defines message 'igmp_enable_disable'.
   247  type IgmpEnableDisable struct {
   248  	Enable    bool                           `binapi:"bool,name=enable" json:"enable,omitempty"`
   249  	Mode      uint8                          `binapi:"u8,name=mode" json:"mode,omitempty"`
   250  	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
   251  }
   252  
   253  func (m *IgmpEnableDisable) Reset()               { *m = IgmpEnableDisable{} }
   254  func (*IgmpEnableDisable) GetMessageName() string { return "igmp_enable_disable" }
   255  func (*IgmpEnableDisable) GetCrcString() string   { return "b1edfb96" }
   256  func (*IgmpEnableDisable) GetMessageType() api.MessageType {
   257  	return api.RequestMessage
   258  }
   259  
   260  func (m *IgmpEnableDisable) Size() (size int) {
   261  	if m == nil {
   262  		return 0
   263  	}
   264  	size += 1 // m.Enable
   265  	size += 1 // m.Mode
   266  	size += 4 // m.SwIfIndex
   267  	return size
   268  }
   269  func (m *IgmpEnableDisable) Marshal(b []byte) ([]byte, error) {
   270  	if b == nil {
   271  		b = make([]byte, m.Size())
   272  	}
   273  	buf := codec.NewBuffer(b)
   274  	buf.EncodeBool(m.Enable)
   275  	buf.EncodeUint8(m.Mode)
   276  	buf.EncodeUint32(uint32(m.SwIfIndex))
   277  	return buf.Bytes(), nil
   278  }
   279  func (m *IgmpEnableDisable) Unmarshal(b []byte) error {
   280  	buf := codec.NewBuffer(b)
   281  	m.Enable = buf.DecodeBool()
   282  	m.Mode = buf.DecodeUint8()
   283  	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
   284  	return nil
   285  }
   286  
   287  // IgmpEnableDisableReply defines message 'igmp_enable_disable_reply'.
   288  type IgmpEnableDisableReply struct {
   289  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
   290  }
   291  
   292  func (m *IgmpEnableDisableReply) Reset()               { *m = IgmpEnableDisableReply{} }
   293  func (*IgmpEnableDisableReply) GetMessageName() string { return "igmp_enable_disable_reply" }
   294  func (*IgmpEnableDisableReply) GetCrcString() string   { return "e8d4e804" }
   295  func (*IgmpEnableDisableReply) GetMessageType() api.MessageType {
   296  	return api.ReplyMessage
   297  }
   298  
   299  func (m *IgmpEnableDisableReply) Size() (size int) {
   300  	if m == nil {
   301  		return 0
   302  	}
   303  	size += 4 // m.Retval
   304  	return size
   305  }
   306  func (m *IgmpEnableDisableReply) Marshal(b []byte) ([]byte, error) {
   307  	if b == nil {
   308  		b = make([]byte, m.Size())
   309  	}
   310  	buf := codec.NewBuffer(b)
   311  	buf.EncodeInt32(m.Retval)
   312  	return buf.Bytes(), nil
   313  }
   314  func (m *IgmpEnableDisableReply) Unmarshal(b []byte) error {
   315  	buf := codec.NewBuffer(b)
   316  	m.Retval = buf.DecodeInt32()
   317  	return nil
   318  }
   319  
   320  // IgmpEvent defines message 'igmp_event'.
   321  type IgmpEvent struct {
   322  	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
   323  	Filter    FilterMode                     `binapi:"filter_mode,name=filter" json:"filter,omitempty"`
   324  	Saddr     ip_types.IP4Address            `binapi:"ip4_address,name=saddr" json:"saddr,omitempty"`
   325  	Gaddr     ip_types.IP4Address            `binapi:"ip4_address,name=gaddr" json:"gaddr,omitempty"`
   326  }
   327  
   328  func (m *IgmpEvent) Reset()               { *m = IgmpEvent{} }
   329  func (*IgmpEvent) GetMessageName() string { return "igmp_event" }
   330  func (*IgmpEvent) GetCrcString() string   { return "85fe93ec" }
   331  func (*IgmpEvent) GetMessageType() api.MessageType {
   332  	return api.OtherMessage
   333  }
   334  
   335  func (m *IgmpEvent) Size() (size int) {
   336  	if m == nil {
   337  		return 0
   338  	}
   339  	size += 4     // m.SwIfIndex
   340  	size += 4     // m.Filter
   341  	size += 1 * 4 // m.Saddr
   342  	size += 1 * 4 // m.Gaddr
   343  	return size
   344  }
   345  func (m *IgmpEvent) Marshal(b []byte) ([]byte, error) {
   346  	if b == nil {
   347  		b = make([]byte, m.Size())
   348  	}
   349  	buf := codec.NewBuffer(b)
   350  	buf.EncodeUint32(uint32(m.SwIfIndex))
   351  	buf.EncodeUint32(uint32(m.Filter))
   352  	buf.EncodeBytes(m.Saddr[:], 4)
   353  	buf.EncodeBytes(m.Gaddr[:], 4)
   354  	return buf.Bytes(), nil
   355  }
   356  func (m *IgmpEvent) Unmarshal(b []byte) error {
   357  	buf := codec.NewBuffer(b)
   358  	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
   359  	m.Filter = FilterMode(buf.DecodeUint32())
   360  	copy(m.Saddr[:], buf.DecodeBytes(4))
   361  	copy(m.Gaddr[:], buf.DecodeBytes(4))
   362  	return nil
   363  }
   364  
   365  // IgmpGroupPrefixDetails defines message 'igmp_group_prefix_details'.
   366  type IgmpGroupPrefixDetails struct {
   367  	Gp GroupPrefix `binapi:"group_prefix,name=gp" json:"gp,omitempty"`
   368  }
   369  
   370  func (m *IgmpGroupPrefixDetails) Reset()               { *m = IgmpGroupPrefixDetails{} }
   371  func (*IgmpGroupPrefixDetails) GetMessageName() string { return "igmp_group_prefix_details" }
   372  func (*IgmpGroupPrefixDetails) GetCrcString() string   { return "259ccd81" }
   373  func (*IgmpGroupPrefixDetails) GetMessageType() api.MessageType {
   374  	return api.ReplyMessage
   375  }
   376  
   377  func (m *IgmpGroupPrefixDetails) Size() (size int) {
   378  	if m == nil {
   379  		return 0
   380  	}
   381  	size += 4      // m.Gp.Type
   382  	size += 1      // m.Gp.Prefix.Address.Af
   383  	size += 1 * 16 // m.Gp.Prefix.Address.Un
   384  	size += 1      // m.Gp.Prefix.Len
   385  	return size
   386  }
   387  func (m *IgmpGroupPrefixDetails) Marshal(b []byte) ([]byte, error) {
   388  	if b == nil {
   389  		b = make([]byte, m.Size())
   390  	}
   391  	buf := codec.NewBuffer(b)
   392  	buf.EncodeUint32(uint32(m.Gp.Type))
   393  	buf.EncodeUint8(uint8(m.Gp.Prefix.Address.Af))
   394  	buf.EncodeBytes(m.Gp.Prefix.Address.Un.XXX_UnionData[:], 16)
   395  	buf.EncodeUint8(m.Gp.Prefix.Len)
   396  	return buf.Bytes(), nil
   397  }
   398  func (m *IgmpGroupPrefixDetails) Unmarshal(b []byte) error {
   399  	buf := codec.NewBuffer(b)
   400  	m.Gp.Type = GroupPrefixType(buf.DecodeUint32())
   401  	m.Gp.Prefix.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
   402  	copy(m.Gp.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
   403  	m.Gp.Prefix.Len = buf.DecodeUint8()
   404  	return nil
   405  }
   406  
   407  // IgmpGroupPrefixDump defines message 'igmp_group_prefix_dump'.
   408  type IgmpGroupPrefixDump struct{}
   409  
   410  func (m *IgmpGroupPrefixDump) Reset()               { *m = IgmpGroupPrefixDump{} }
   411  func (*IgmpGroupPrefixDump) GetMessageName() string { return "igmp_group_prefix_dump" }
   412  func (*IgmpGroupPrefixDump) GetCrcString() string   { return "51077d14" }
   413  func (*IgmpGroupPrefixDump) GetMessageType() api.MessageType {
   414  	return api.RequestMessage
   415  }
   416  
   417  func (m *IgmpGroupPrefixDump) Size() (size int) {
   418  	if m == nil {
   419  		return 0
   420  	}
   421  	return size
   422  }
   423  func (m *IgmpGroupPrefixDump) Marshal(b []byte) ([]byte, error) {
   424  	if b == nil {
   425  		b = make([]byte, m.Size())
   426  	}
   427  	buf := codec.NewBuffer(b)
   428  	return buf.Bytes(), nil
   429  }
   430  func (m *IgmpGroupPrefixDump) Unmarshal(b []byte) error {
   431  	return nil
   432  }
   433  
   434  // IgmpGroupPrefixSet defines message 'igmp_group_prefix_set'.
   435  type IgmpGroupPrefixSet struct {
   436  	Gp GroupPrefix `binapi:"group_prefix,name=gp" json:"gp,omitempty"`
   437  }
   438  
   439  func (m *IgmpGroupPrefixSet) Reset()               { *m = IgmpGroupPrefixSet{} }
   440  func (*IgmpGroupPrefixSet) GetMessageName() string { return "igmp_group_prefix_set" }
   441  func (*IgmpGroupPrefixSet) GetCrcString() string   { return "5b14a5ce" }
   442  func (*IgmpGroupPrefixSet) GetMessageType() api.MessageType {
   443  	return api.RequestMessage
   444  }
   445  
   446  func (m *IgmpGroupPrefixSet) Size() (size int) {
   447  	if m == nil {
   448  		return 0
   449  	}
   450  	size += 4      // m.Gp.Type
   451  	size += 1      // m.Gp.Prefix.Address.Af
   452  	size += 1 * 16 // m.Gp.Prefix.Address.Un
   453  	size += 1      // m.Gp.Prefix.Len
   454  	return size
   455  }
   456  func (m *IgmpGroupPrefixSet) Marshal(b []byte) ([]byte, error) {
   457  	if b == nil {
   458  		b = make([]byte, m.Size())
   459  	}
   460  	buf := codec.NewBuffer(b)
   461  	buf.EncodeUint32(uint32(m.Gp.Type))
   462  	buf.EncodeUint8(uint8(m.Gp.Prefix.Address.Af))
   463  	buf.EncodeBytes(m.Gp.Prefix.Address.Un.XXX_UnionData[:], 16)
   464  	buf.EncodeUint8(m.Gp.Prefix.Len)
   465  	return buf.Bytes(), nil
   466  }
   467  func (m *IgmpGroupPrefixSet) Unmarshal(b []byte) error {
   468  	buf := codec.NewBuffer(b)
   469  	m.Gp.Type = GroupPrefixType(buf.DecodeUint32())
   470  	m.Gp.Prefix.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
   471  	copy(m.Gp.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
   472  	m.Gp.Prefix.Len = buf.DecodeUint8()
   473  	return nil
   474  }
   475  
   476  // IgmpGroupPrefixSetReply defines message 'igmp_group_prefix_set_reply'.
   477  type IgmpGroupPrefixSetReply struct {
   478  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
   479  }
   480  
   481  func (m *IgmpGroupPrefixSetReply) Reset()               { *m = IgmpGroupPrefixSetReply{} }
   482  func (*IgmpGroupPrefixSetReply) GetMessageName() string { return "igmp_group_prefix_set_reply" }
   483  func (*IgmpGroupPrefixSetReply) GetCrcString() string   { return "e8d4e804" }
   484  func (*IgmpGroupPrefixSetReply) GetMessageType() api.MessageType {
   485  	return api.ReplyMessage
   486  }
   487  
   488  func (m *IgmpGroupPrefixSetReply) Size() (size int) {
   489  	if m == nil {
   490  		return 0
   491  	}
   492  	size += 4 // m.Retval
   493  	return size
   494  }
   495  func (m *IgmpGroupPrefixSetReply) Marshal(b []byte) ([]byte, error) {
   496  	if b == nil {
   497  		b = make([]byte, m.Size())
   498  	}
   499  	buf := codec.NewBuffer(b)
   500  	buf.EncodeInt32(m.Retval)
   501  	return buf.Bytes(), nil
   502  }
   503  func (m *IgmpGroupPrefixSetReply) Unmarshal(b []byte) error {
   504  	buf := codec.NewBuffer(b)
   505  	m.Retval = buf.DecodeInt32()
   506  	return nil
   507  }
   508  
   509  // IgmpListen defines message 'igmp_listen'.
   510  type IgmpListen struct {
   511  	Group IgmpGroup `binapi:"igmp_group,name=group" json:"group,omitempty"`
   512  }
   513  
   514  func (m *IgmpListen) Reset()               { *m = IgmpListen{} }
   515  func (*IgmpListen) GetMessageName() string { return "igmp_listen" }
   516  func (*IgmpListen) GetCrcString() string   { return "19a49f1e" }
   517  func (*IgmpListen) GetMessageType() api.MessageType {
   518  	return api.RequestMessage
   519  }
   520  
   521  func (m *IgmpListen) Size() (size int) {
   522  	if m == nil {
   523  		return 0
   524  	}
   525  	size += 4     // m.Group.Filter
   526  	size += 1     // m.Group.NSrcs
   527  	size += 4     // m.Group.SwIfIndex
   528  	size += 1 * 4 // m.Group.Gaddr
   529  	for j2 := 0; j2 < len(m.Group.Saddrs); j2++ {
   530  		var s2 ip_types.IP4Address
   531  		_ = s2
   532  		if j2 < len(m.Group.Saddrs) {
   533  			s2 = m.Group.Saddrs[j2]
   534  		}
   535  		size += 1 * 4 // s2
   536  	}
   537  	return size
   538  }
   539  func (m *IgmpListen) Marshal(b []byte) ([]byte, error) {
   540  	if b == nil {
   541  		b = make([]byte, m.Size())
   542  	}
   543  	buf := codec.NewBuffer(b)
   544  	buf.EncodeUint32(uint32(m.Group.Filter))
   545  	buf.EncodeUint8(uint8(len(m.Group.Saddrs)))
   546  	buf.EncodeUint32(uint32(m.Group.SwIfIndex))
   547  	buf.EncodeBytes(m.Group.Gaddr[:], 4)
   548  	for j1 := 0; j1 < len(m.Group.Saddrs); j1++ {
   549  		var v1 ip_types.IP4Address // Saddrs
   550  		if j1 < len(m.Group.Saddrs) {
   551  			v1 = m.Group.Saddrs[j1]
   552  		}
   553  		buf.EncodeBytes(v1[:], 4)
   554  	}
   555  	return buf.Bytes(), nil
   556  }
   557  func (m *IgmpListen) Unmarshal(b []byte) error {
   558  	buf := codec.NewBuffer(b)
   559  	m.Group.Filter = FilterMode(buf.DecodeUint32())
   560  	m.Group.NSrcs = buf.DecodeUint8()
   561  	m.Group.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
   562  	copy(m.Group.Gaddr[:], buf.DecodeBytes(4))
   563  	m.Group.Saddrs = make([]ip_types.IP4Address, m.Group.NSrcs)
   564  	for j1 := 0; j1 < len(m.Group.Saddrs); j1++ {
   565  		copy(m.Group.Saddrs[j1][:], buf.DecodeBytes(4))
   566  	}
   567  	return nil
   568  }
   569  
   570  // IgmpListenReply defines message 'igmp_listen_reply'.
   571  type IgmpListenReply struct {
   572  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
   573  }
   574  
   575  func (m *IgmpListenReply) Reset()               { *m = IgmpListenReply{} }
   576  func (*IgmpListenReply) GetMessageName() string { return "igmp_listen_reply" }
   577  func (*IgmpListenReply) GetCrcString() string   { return "e8d4e804" }
   578  func (*IgmpListenReply) GetMessageType() api.MessageType {
   579  	return api.ReplyMessage
   580  }
   581  
   582  func (m *IgmpListenReply) Size() (size int) {
   583  	if m == nil {
   584  		return 0
   585  	}
   586  	size += 4 // m.Retval
   587  	return size
   588  }
   589  func (m *IgmpListenReply) Marshal(b []byte) ([]byte, error) {
   590  	if b == nil {
   591  		b = make([]byte, m.Size())
   592  	}
   593  	buf := codec.NewBuffer(b)
   594  	buf.EncodeInt32(m.Retval)
   595  	return buf.Bytes(), nil
   596  }
   597  func (m *IgmpListenReply) Unmarshal(b []byte) error {
   598  	buf := codec.NewBuffer(b)
   599  	m.Retval = buf.DecodeInt32()
   600  	return nil
   601  }
   602  
   603  // IgmpProxyDeviceAddDel defines message 'igmp_proxy_device_add_del'.
   604  type IgmpProxyDeviceAddDel struct {
   605  	Add       uint8                          `binapi:"u8,name=add" json:"add,omitempty"`
   606  	VrfID     uint32                         `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
   607  	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
   608  }
   609  
   610  func (m *IgmpProxyDeviceAddDel) Reset()               { *m = IgmpProxyDeviceAddDel{} }
   611  func (*IgmpProxyDeviceAddDel) GetMessageName() string { return "igmp_proxy_device_add_del" }
   612  func (*IgmpProxyDeviceAddDel) GetCrcString() string   { return "0b9be9ce" }
   613  func (*IgmpProxyDeviceAddDel) GetMessageType() api.MessageType {
   614  	return api.RequestMessage
   615  }
   616  
   617  func (m *IgmpProxyDeviceAddDel) Size() (size int) {
   618  	if m == nil {
   619  		return 0
   620  	}
   621  	size += 1 // m.Add
   622  	size += 4 // m.VrfID
   623  	size += 4 // m.SwIfIndex
   624  	return size
   625  }
   626  func (m *IgmpProxyDeviceAddDel) Marshal(b []byte) ([]byte, error) {
   627  	if b == nil {
   628  		b = make([]byte, m.Size())
   629  	}
   630  	buf := codec.NewBuffer(b)
   631  	buf.EncodeUint8(m.Add)
   632  	buf.EncodeUint32(m.VrfID)
   633  	buf.EncodeUint32(uint32(m.SwIfIndex))
   634  	return buf.Bytes(), nil
   635  }
   636  func (m *IgmpProxyDeviceAddDel) Unmarshal(b []byte) error {
   637  	buf := codec.NewBuffer(b)
   638  	m.Add = buf.DecodeUint8()
   639  	m.VrfID = buf.DecodeUint32()
   640  	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
   641  	return nil
   642  }
   643  
   644  // IgmpProxyDeviceAddDelInterface defines message 'igmp_proxy_device_add_del_interface'.
   645  type IgmpProxyDeviceAddDelInterface struct {
   646  	Add       bool                           `binapi:"bool,name=add" json:"add,omitempty"`
   647  	VrfID     uint32                         `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
   648  	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
   649  }
   650  
   651  func (m *IgmpProxyDeviceAddDelInterface) Reset() { *m = IgmpProxyDeviceAddDelInterface{} }
   652  func (*IgmpProxyDeviceAddDelInterface) GetMessageName() string {
   653  	return "igmp_proxy_device_add_del_interface"
   654  }
   655  func (*IgmpProxyDeviceAddDelInterface) GetCrcString() string { return "1a9ec24a" }
   656  func (*IgmpProxyDeviceAddDelInterface) GetMessageType() api.MessageType {
   657  	return api.RequestMessage
   658  }
   659  
   660  func (m *IgmpProxyDeviceAddDelInterface) Size() (size int) {
   661  	if m == nil {
   662  		return 0
   663  	}
   664  	size += 1 // m.Add
   665  	size += 4 // m.VrfID
   666  	size += 4 // m.SwIfIndex
   667  	return size
   668  }
   669  func (m *IgmpProxyDeviceAddDelInterface) Marshal(b []byte) ([]byte, error) {
   670  	if b == nil {
   671  		b = make([]byte, m.Size())
   672  	}
   673  	buf := codec.NewBuffer(b)
   674  	buf.EncodeBool(m.Add)
   675  	buf.EncodeUint32(m.VrfID)
   676  	buf.EncodeUint32(uint32(m.SwIfIndex))
   677  	return buf.Bytes(), nil
   678  }
   679  func (m *IgmpProxyDeviceAddDelInterface) Unmarshal(b []byte) error {
   680  	buf := codec.NewBuffer(b)
   681  	m.Add = buf.DecodeBool()
   682  	m.VrfID = buf.DecodeUint32()
   683  	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
   684  	return nil
   685  }
   686  
   687  // IgmpProxyDeviceAddDelInterfaceReply defines message 'igmp_proxy_device_add_del_interface_reply'.
   688  type IgmpProxyDeviceAddDelInterfaceReply struct {
   689  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
   690  }
   691  
   692  func (m *IgmpProxyDeviceAddDelInterfaceReply) Reset() { *m = IgmpProxyDeviceAddDelInterfaceReply{} }
   693  func (*IgmpProxyDeviceAddDelInterfaceReply) GetMessageName() string {
   694  	return "igmp_proxy_device_add_del_interface_reply"
   695  }
   696  func (*IgmpProxyDeviceAddDelInterfaceReply) GetCrcString() string { return "e8d4e804" }
   697  func (*IgmpProxyDeviceAddDelInterfaceReply) GetMessageType() api.MessageType {
   698  	return api.ReplyMessage
   699  }
   700  
   701  func (m *IgmpProxyDeviceAddDelInterfaceReply) Size() (size int) {
   702  	if m == nil {
   703  		return 0
   704  	}
   705  	size += 4 // m.Retval
   706  	return size
   707  }
   708  func (m *IgmpProxyDeviceAddDelInterfaceReply) Marshal(b []byte) ([]byte, error) {
   709  	if b == nil {
   710  		b = make([]byte, m.Size())
   711  	}
   712  	buf := codec.NewBuffer(b)
   713  	buf.EncodeInt32(m.Retval)
   714  	return buf.Bytes(), nil
   715  }
   716  func (m *IgmpProxyDeviceAddDelInterfaceReply) Unmarshal(b []byte) error {
   717  	buf := codec.NewBuffer(b)
   718  	m.Retval = buf.DecodeInt32()
   719  	return nil
   720  }
   721  
   722  // IgmpProxyDeviceAddDelReply defines message 'igmp_proxy_device_add_del_reply'.
   723  type IgmpProxyDeviceAddDelReply struct {
   724  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
   725  }
   726  
   727  func (m *IgmpProxyDeviceAddDelReply) Reset()               { *m = IgmpProxyDeviceAddDelReply{} }
   728  func (*IgmpProxyDeviceAddDelReply) GetMessageName() string { return "igmp_proxy_device_add_del_reply" }
   729  func (*IgmpProxyDeviceAddDelReply) GetCrcString() string   { return "e8d4e804" }
   730  func (*IgmpProxyDeviceAddDelReply) GetMessageType() api.MessageType {
   731  	return api.ReplyMessage
   732  }
   733  
   734  func (m *IgmpProxyDeviceAddDelReply) Size() (size int) {
   735  	if m == nil {
   736  		return 0
   737  	}
   738  	size += 4 // m.Retval
   739  	return size
   740  }
   741  func (m *IgmpProxyDeviceAddDelReply) Marshal(b []byte) ([]byte, error) {
   742  	if b == nil {
   743  		b = make([]byte, m.Size())
   744  	}
   745  	buf := codec.NewBuffer(b)
   746  	buf.EncodeInt32(m.Retval)
   747  	return buf.Bytes(), nil
   748  }
   749  func (m *IgmpProxyDeviceAddDelReply) Unmarshal(b []byte) error {
   750  	buf := codec.NewBuffer(b)
   751  	m.Retval = buf.DecodeInt32()
   752  	return nil
   753  }
   754  
   755  // WantIgmpEvents defines message 'want_igmp_events'.
   756  type WantIgmpEvents struct {
   757  	Enable uint32 `binapi:"u32,name=enable" json:"enable,omitempty"`
   758  	PID    uint32 `binapi:"u32,name=pid" json:"pid,omitempty"`
   759  }
   760  
   761  func (m *WantIgmpEvents) Reset()               { *m = WantIgmpEvents{} }
   762  func (*WantIgmpEvents) GetMessageName() string { return "want_igmp_events" }
   763  func (*WantIgmpEvents) GetCrcString() string   { return "cfaccc1f" }
   764  func (*WantIgmpEvents) GetMessageType() api.MessageType {
   765  	return api.RequestMessage
   766  }
   767  
   768  func (m *WantIgmpEvents) Size() (size int) {
   769  	if m == nil {
   770  		return 0
   771  	}
   772  	size += 4 // m.Enable
   773  	size += 4 // m.PID
   774  	return size
   775  }
   776  func (m *WantIgmpEvents) Marshal(b []byte) ([]byte, error) {
   777  	if b == nil {
   778  		b = make([]byte, m.Size())
   779  	}
   780  	buf := codec.NewBuffer(b)
   781  	buf.EncodeUint32(m.Enable)
   782  	buf.EncodeUint32(m.PID)
   783  	return buf.Bytes(), nil
   784  }
   785  func (m *WantIgmpEvents) Unmarshal(b []byte) error {
   786  	buf := codec.NewBuffer(b)
   787  	m.Enable = buf.DecodeUint32()
   788  	m.PID = buf.DecodeUint32()
   789  	return nil
   790  }
   791  
   792  // WantIgmpEventsReply defines message 'want_igmp_events_reply'.
   793  type WantIgmpEventsReply struct {
   794  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
   795  }
   796  
   797  func (m *WantIgmpEventsReply) Reset()               { *m = WantIgmpEventsReply{} }
   798  func (*WantIgmpEventsReply) GetMessageName() string { return "want_igmp_events_reply" }
   799  func (*WantIgmpEventsReply) GetCrcString() string   { return "e8d4e804" }
   800  func (*WantIgmpEventsReply) GetMessageType() api.MessageType {
   801  	return api.ReplyMessage
   802  }
   803  
   804  func (m *WantIgmpEventsReply) Size() (size int) {
   805  	if m == nil {
   806  		return 0
   807  	}
   808  	size += 4 // m.Retval
   809  	return size
   810  }
   811  func (m *WantIgmpEventsReply) Marshal(b []byte) ([]byte, error) {
   812  	if b == nil {
   813  		b = make([]byte, m.Size())
   814  	}
   815  	buf := codec.NewBuffer(b)
   816  	buf.EncodeInt32(m.Retval)
   817  	return buf.Bytes(), nil
   818  }
   819  func (m *WantIgmpEventsReply) Unmarshal(b []byte) error {
   820  	buf := codec.NewBuffer(b)
   821  	m.Retval = buf.DecodeInt32()
   822  	return nil
   823  }
   824  
   825  func init() { file_igmp_binapi_init() }
   826  func file_igmp_binapi_init() {
   827  	api.RegisterMessage((*IgmpClearInterface)(nil), "igmp_clear_interface_f9e6675e")
   828  	api.RegisterMessage((*IgmpClearInterfaceReply)(nil), "igmp_clear_interface_reply_e8d4e804")
   829  	api.RegisterMessage((*IgmpDetails)(nil), "igmp_details_38f09929")
   830  	api.RegisterMessage((*IgmpDump)(nil), "igmp_dump_f9e6675e")
   831  	api.RegisterMessage((*IgmpEnableDisable)(nil), "igmp_enable_disable_b1edfb96")
   832  	api.RegisterMessage((*IgmpEnableDisableReply)(nil), "igmp_enable_disable_reply_e8d4e804")
   833  	api.RegisterMessage((*IgmpEvent)(nil), "igmp_event_85fe93ec")
   834  	api.RegisterMessage((*IgmpGroupPrefixDetails)(nil), "igmp_group_prefix_details_259ccd81")
   835  	api.RegisterMessage((*IgmpGroupPrefixDump)(nil), "igmp_group_prefix_dump_51077d14")
   836  	api.RegisterMessage((*IgmpGroupPrefixSet)(nil), "igmp_group_prefix_set_5b14a5ce")
   837  	api.RegisterMessage((*IgmpGroupPrefixSetReply)(nil), "igmp_group_prefix_set_reply_e8d4e804")
   838  	api.RegisterMessage((*IgmpListen)(nil), "igmp_listen_19a49f1e")
   839  	api.RegisterMessage((*IgmpListenReply)(nil), "igmp_listen_reply_e8d4e804")
   840  	api.RegisterMessage((*IgmpProxyDeviceAddDel)(nil), "igmp_proxy_device_add_del_0b9be9ce")
   841  	api.RegisterMessage((*IgmpProxyDeviceAddDelInterface)(nil), "igmp_proxy_device_add_del_interface_1a9ec24a")
   842  	api.RegisterMessage((*IgmpProxyDeviceAddDelInterfaceReply)(nil), "igmp_proxy_device_add_del_interface_reply_e8d4e804")
   843  	api.RegisterMessage((*IgmpProxyDeviceAddDelReply)(nil), "igmp_proxy_device_add_del_reply_e8d4e804")
   844  	api.RegisterMessage((*WantIgmpEvents)(nil), "want_igmp_events_cfaccc1f")
   845  	api.RegisterMessage((*WantIgmpEventsReply)(nil), "want_igmp_events_reply_e8d4e804")
   846  }
   847  
   848  // Messages returns list of all messages in this module.
   849  func AllMessages() []api.Message {
   850  	return []api.Message{
   851  		(*IgmpClearInterface)(nil),
   852  		(*IgmpClearInterfaceReply)(nil),
   853  		(*IgmpDetails)(nil),
   854  		(*IgmpDump)(nil),
   855  		(*IgmpEnableDisable)(nil),
   856  		(*IgmpEnableDisableReply)(nil),
   857  		(*IgmpEvent)(nil),
   858  		(*IgmpGroupPrefixDetails)(nil),
   859  		(*IgmpGroupPrefixDump)(nil),
   860  		(*IgmpGroupPrefixSet)(nil),
   861  		(*IgmpGroupPrefixSetReply)(nil),
   862  		(*IgmpListen)(nil),
   863  		(*IgmpListenReply)(nil),
   864  		(*IgmpProxyDeviceAddDel)(nil),
   865  		(*IgmpProxyDeviceAddDelInterface)(nil),
   866  		(*IgmpProxyDeviceAddDelInterfaceReply)(nil),
   867  		(*IgmpProxyDeviceAddDelReply)(nil),
   868  		(*WantIgmpEvents)(nil),
   869  		(*WantIgmpEventsReply)(nil),
   870  	}
   871  }