github.com/onosproject/onos-api/go@v0.10.32/onos/stratum/p4_role_config.pb.go (about)

     1  // Code generated by protoc-gen-gogo. DO NOT EDIT.
     2  // source: onos/stratum/p4_role_config.proto
     3  
     4  package stratum
     5  
     6  import (
     7  	fmt "fmt"
     8  	proto "github.com/gogo/protobuf/proto"
     9  	io "io"
    10  	math "math"
    11  	math_bits "math/bits"
    12  )
    13  
    14  // Reference imports to suppress errors if they are not otherwise used.
    15  var _ = proto.Marshal
    16  var _ = fmt.Errorf
    17  var _ = math.Inf
    18  
    19  // This is a compile-time assertion to ensure that this generated file
    20  // is compatible with the proto package it is being compiled against.
    21  // A compilation error at this line likely means your copy of the
    22  // proto package needs to be updated.
    23  const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
    24  
    25  // The P4RoleConfig message conists of these fields:
    26  //
    27  //	exclusive_p4_ids - A list of P4 entities for which this role exclusivly may
    28  //	    issue Write updates. Those entities are also filtered out of Read
    29  //	    responses.
    30  //	shared_p4_ids - A list of P4 entities for which this role may issue Write
    31  //	    updates. Access to those entities is shared with other roles. Those
    32  //	    entities are also filtered out of Read responses.
    33  //	packet_in_filter - A single PacketFilter that is applied to incoming packets
    34  //	    to determine whether this role should receive them. An empty list
    35  //	    results in no filtering. This is a positive filter, a packet must
    36  //	    contain the exact specified value to be forwarded.
    37  //	receives_packet_ins - A toggle to set if this role should receive PacketIns.
    38  //	can_push_pipeline - Determines if this role is allowed to push a pipeline.
    39  type P4RoleConfig struct {
    40  	ExclusiveP4Ids    []uint32                   `protobuf:"varint,1,rep,packed,name=exclusive_p4_ids,json=exclusiveP4Ids,proto3" json:"exclusive_p4_ids,omitempty"`
    41  	SharedP4Ids       []uint32                   `protobuf:"varint,2,rep,packed,name=shared_p4_ids,json=sharedP4Ids,proto3" json:"shared_p4_ids,omitempty"`
    42  	PacketInFilter    *P4RoleConfig_PacketFilter `protobuf:"bytes,3,opt,name=packet_in_filter,json=packetInFilter,proto3" json:"packet_in_filter,omitempty"`
    43  	ReceivesPacketIns bool                       `protobuf:"varint,4,opt,name=receives_packet_ins,json=receivesPacketIns,proto3" json:"receives_packet_ins,omitempty"`
    44  	CanPushPipeline   bool                       `protobuf:"varint,5,opt,name=can_push_pipeline,json=canPushPipeline,proto3" json:"can_push_pipeline,omitempty"`
    45  }
    46  
    47  func (m *P4RoleConfig) Reset()         { *m = P4RoleConfig{} }
    48  func (m *P4RoleConfig) String() string { return proto.CompactTextString(m) }
    49  func (*P4RoleConfig) ProtoMessage()    {}
    50  func (*P4RoleConfig) Descriptor() ([]byte, []int) {
    51  	return fileDescriptor_5a00f574e6a28476, []int{0}
    52  }
    53  func (m *P4RoleConfig) XXX_Unmarshal(b []byte) error {
    54  	return m.Unmarshal(b)
    55  }
    56  func (m *P4RoleConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
    57  	if deterministic {
    58  		return xxx_messageInfo_P4RoleConfig.Marshal(b, m, deterministic)
    59  	} else {
    60  		b = b[:cap(b)]
    61  		n, err := m.MarshalToSizedBuffer(b)
    62  		if err != nil {
    63  			return nil, err
    64  		}
    65  		return b[:n], nil
    66  	}
    67  }
    68  func (m *P4RoleConfig) XXX_Merge(src proto.Message) {
    69  	xxx_messageInfo_P4RoleConfig.Merge(m, src)
    70  }
    71  func (m *P4RoleConfig) XXX_Size() int {
    72  	return m.Size()
    73  }
    74  func (m *P4RoleConfig) XXX_DiscardUnknown() {
    75  	xxx_messageInfo_P4RoleConfig.DiscardUnknown(m)
    76  }
    77  
    78  var xxx_messageInfo_P4RoleConfig proto.InternalMessageInfo
    79  
    80  func (m *P4RoleConfig) GetExclusiveP4Ids() []uint32 {
    81  	if m != nil {
    82  		return m.ExclusiveP4Ids
    83  	}
    84  	return nil
    85  }
    86  
    87  func (m *P4RoleConfig) GetSharedP4Ids() []uint32 {
    88  	if m != nil {
    89  		return m.SharedP4Ids
    90  	}
    91  	return nil
    92  }
    93  
    94  func (m *P4RoleConfig) GetPacketInFilter() *P4RoleConfig_PacketFilter {
    95  	if m != nil {
    96  		return m.PacketInFilter
    97  	}
    98  	return nil
    99  }
   100  
   101  func (m *P4RoleConfig) GetReceivesPacketIns() bool {
   102  	if m != nil {
   103  		return m.ReceivesPacketIns
   104  	}
   105  	return false
   106  }
   107  
   108  func (m *P4RoleConfig) GetCanPushPipeline() bool {
   109  	if m != nil {
   110  		return m.CanPushPipeline
   111  	}
   112  	return false
   113  }
   114  
   115  type P4RoleConfig_PacketFilter struct {
   116  	MetadataId uint32 `protobuf:"varint,1,opt,name=metadata_id,json=metadataId,proto3" json:"metadata_id,omitempty"`
   117  	Value      []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
   118  }
   119  
   120  func (m *P4RoleConfig_PacketFilter) Reset()         { *m = P4RoleConfig_PacketFilter{} }
   121  func (m *P4RoleConfig_PacketFilter) String() string { return proto.CompactTextString(m) }
   122  func (*P4RoleConfig_PacketFilter) ProtoMessage()    {}
   123  func (*P4RoleConfig_PacketFilter) Descriptor() ([]byte, []int) {
   124  	return fileDescriptor_5a00f574e6a28476, []int{0, 0}
   125  }
   126  func (m *P4RoleConfig_PacketFilter) XXX_Unmarshal(b []byte) error {
   127  	return m.Unmarshal(b)
   128  }
   129  func (m *P4RoleConfig_PacketFilter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
   130  	if deterministic {
   131  		return xxx_messageInfo_P4RoleConfig_PacketFilter.Marshal(b, m, deterministic)
   132  	} else {
   133  		b = b[:cap(b)]
   134  		n, err := m.MarshalToSizedBuffer(b)
   135  		if err != nil {
   136  			return nil, err
   137  		}
   138  		return b[:n], nil
   139  	}
   140  }
   141  func (m *P4RoleConfig_PacketFilter) XXX_Merge(src proto.Message) {
   142  	xxx_messageInfo_P4RoleConfig_PacketFilter.Merge(m, src)
   143  }
   144  func (m *P4RoleConfig_PacketFilter) XXX_Size() int {
   145  	return m.Size()
   146  }
   147  func (m *P4RoleConfig_PacketFilter) XXX_DiscardUnknown() {
   148  	xxx_messageInfo_P4RoleConfig_PacketFilter.DiscardUnknown(m)
   149  }
   150  
   151  var xxx_messageInfo_P4RoleConfig_PacketFilter proto.InternalMessageInfo
   152  
   153  func (m *P4RoleConfig_PacketFilter) GetMetadataId() uint32 {
   154  	if m != nil {
   155  		return m.MetadataId
   156  	}
   157  	return 0
   158  }
   159  
   160  func (m *P4RoleConfig_PacketFilter) GetValue() []byte {
   161  	if m != nil {
   162  		return m.Value
   163  	}
   164  	return nil
   165  }
   166  
   167  func init() {
   168  	proto.RegisterType((*P4RoleConfig)(nil), "stratum.P4RoleConfig")
   169  	proto.RegisterType((*P4RoleConfig_PacketFilter)(nil), "stratum.P4RoleConfig.PacketFilter")
   170  }
   171  
   172  func init() { proto.RegisterFile("onos/stratum/p4_role_config.proto", fileDescriptor_5a00f574e6a28476) }
   173  
   174  var fileDescriptor_5a00f574e6a28476 = []byte{
   175  	// 317 bytes of a gzipped FileDescriptorProto
   176  	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x90, 0x4f, 0x4b, 0xc3, 0x30,
   177  	0x18, 0xc6, 0x9b, 0xcd, 0xa9, 0x64, 0x7f, 0xdc, 0xa2, 0x87, 0xa2, 0x50, 0xeb, 0x4e, 0xc5, 0x43,
   178  	0x07, 0xda, 0x4f, 0xa0, 0x28, 0x0c, 0x3c, 0x94, 0x7e, 0x81, 0x10, 0xdb, 0x77, 0x2e, 0xd8, 0x25,
   179  	0x21, 0x49, 0x87, 0x47, 0x3f, 0x82, 0x1f, 0xcb, 0x8b, 0xb0, 0xa3, 0x47, 0xd9, 0xbe, 0x88, 0x90,
   180  	0xb6, 0x63, 0xc7, 0xf7, 0xf7, 0xfc, 0xde, 0x3c, 0xe1, 0xc5, 0x37, 0x52, 0x48, 0x33, 0x33, 0x56,
   181  	0x33, 0x5b, 0xad, 0x66, 0x2a, 0xa1, 0x5a, 0x96, 0x40, 0x73, 0x29, 0x16, 0xfc, 0x2d, 0x56, 0x5a,
   182  	0x5a, 0x49, 0x4e, 0x9a, 0x74, 0xfa, 0xd3, 0xc1, 0x83, 0x34, 0xc9, 0x64, 0x09, 0x8f, 0x2e, 0x27,
   183  	0x11, 0x1e, 0xc3, 0x47, 0x5e, 0x56, 0x86, 0xaf, 0x81, 0xaa, 0x84, 0xf2, 0xc2, 0xf8, 0x28, 0xec,
   184  	0x46, 0xc3, 0x6c, 0xb4, 0xe7, 0x69, 0x32, 0x2f, 0x0c, 0x99, 0xe2, 0xa1, 0x59, 0x32, 0x0d, 0x45,
   185  	0xab, 0x75, 0x9c, 0xd6, 0xaf, 0x61, 0xed, 0xbc, 0xe0, 0xb1, 0x62, 0xf9, 0x3b, 0x58, 0xca, 0x05,
   186  	0x5d, 0xf0, 0xd2, 0x82, 0xf6, 0xbb, 0x21, 0x8a, 0xfa, 0x77, 0xd3, 0xb8, 0xf9, 0x42, 0x7c, 0x58,
   187  	0x1f, 0xa7, 0xce, 0x7e, 0x76, 0x66, 0x36, 0xaa, 0x77, 0xe7, 0xa2, 0x9e, 0x49, 0x8c, 0xcf, 0x35,
   188  	0xe4, 0xc0, 0xd7, 0x60, 0xe8, 0xfe, 0x59, 0xe3, 0x1f, 0x85, 0x28, 0x3a, 0xcd, 0x26, 0x6d, 0x94,
   189  	0x36, 0x4b, 0x86, 0xdc, 0xe2, 0x49, 0xce, 0x04, 0x55, 0x95, 0x59, 0x52, 0xc5, 0x15, 0x94, 0x5c,
   190  	0x80, 0xdf, 0x73, 0xf6, 0x59, 0xce, 0x44, 0x5a, 0x99, 0x65, 0xda, 0xe0, 0xcb, 0x27, 0x3c, 0x38,
   191  	0xec, 0x26, 0xd7, 0xb8, 0xbf, 0x02, 0xcb, 0x0a, 0x66, 0x19, 0xe5, 0x85, 0x8f, 0x42, 0x14, 0x0d,
   192  	0x33, 0xdc, 0xa2, 0x79, 0x41, 0x2e, 0x70, 0x6f, 0xcd, 0xca, 0x0a, 0xfc, 0x4e, 0x88, 0xa2, 0x41,
   193  	0x56, 0x0f, 0x0f, 0x57, 0xdf, 0xdb, 0x00, 0x6d, 0xb6, 0x01, 0xfa, 0xdb, 0x06, 0xe8, 0x6b, 0x17,
   194  	0x78, 0x9b, 0x5d, 0xe0, 0xfd, 0xee, 0x02, 0xef, 0x13, 0x79, 0xaf, 0xc7, 0xee, 0xf8, 0xf7, 0xff,
   195  	0x01, 0x00, 0x00, 0xff, 0xff, 0x67, 0x4f, 0x38, 0xca, 0xa1, 0x01, 0x00, 0x00,
   196  }
   197  
   198  func (m *P4RoleConfig) Marshal() (dAtA []byte, err error) {
   199  	size := m.Size()
   200  	dAtA = make([]byte, size)
   201  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
   202  	if err != nil {
   203  		return nil, err
   204  	}
   205  	return dAtA[:n], nil
   206  }
   207  
   208  func (m *P4RoleConfig) MarshalTo(dAtA []byte) (int, error) {
   209  	size := m.Size()
   210  	return m.MarshalToSizedBuffer(dAtA[:size])
   211  }
   212  
   213  func (m *P4RoleConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   214  	i := len(dAtA)
   215  	_ = i
   216  	var l int
   217  	_ = l
   218  	if m.CanPushPipeline {
   219  		i--
   220  		if m.CanPushPipeline {
   221  			dAtA[i] = 1
   222  		} else {
   223  			dAtA[i] = 0
   224  		}
   225  		i--
   226  		dAtA[i] = 0x28
   227  	}
   228  	if m.ReceivesPacketIns {
   229  		i--
   230  		if m.ReceivesPacketIns {
   231  			dAtA[i] = 1
   232  		} else {
   233  			dAtA[i] = 0
   234  		}
   235  		i--
   236  		dAtA[i] = 0x20
   237  	}
   238  	if m.PacketInFilter != nil {
   239  		{
   240  			size, err := m.PacketInFilter.MarshalToSizedBuffer(dAtA[:i])
   241  			if err != nil {
   242  				return 0, err
   243  			}
   244  			i -= size
   245  			i = encodeVarintP4RoleConfig(dAtA, i, uint64(size))
   246  		}
   247  		i--
   248  		dAtA[i] = 0x1a
   249  	}
   250  	if len(m.SharedP4Ids) > 0 {
   251  		dAtA3 := make([]byte, len(m.SharedP4Ids)*10)
   252  		var j2 int
   253  		for _, num := range m.SharedP4Ids {
   254  			for num >= 1<<7 {
   255  				dAtA3[j2] = uint8(uint64(num)&0x7f | 0x80)
   256  				num >>= 7
   257  				j2++
   258  			}
   259  			dAtA3[j2] = uint8(num)
   260  			j2++
   261  		}
   262  		i -= j2
   263  		copy(dAtA[i:], dAtA3[:j2])
   264  		i = encodeVarintP4RoleConfig(dAtA, i, uint64(j2))
   265  		i--
   266  		dAtA[i] = 0x12
   267  	}
   268  	if len(m.ExclusiveP4Ids) > 0 {
   269  		dAtA5 := make([]byte, len(m.ExclusiveP4Ids)*10)
   270  		var j4 int
   271  		for _, num := range m.ExclusiveP4Ids {
   272  			for num >= 1<<7 {
   273  				dAtA5[j4] = uint8(uint64(num)&0x7f | 0x80)
   274  				num >>= 7
   275  				j4++
   276  			}
   277  			dAtA5[j4] = uint8(num)
   278  			j4++
   279  		}
   280  		i -= j4
   281  		copy(dAtA[i:], dAtA5[:j4])
   282  		i = encodeVarintP4RoleConfig(dAtA, i, uint64(j4))
   283  		i--
   284  		dAtA[i] = 0xa
   285  	}
   286  	return len(dAtA) - i, nil
   287  }
   288  
   289  func (m *P4RoleConfig_PacketFilter) Marshal() (dAtA []byte, err error) {
   290  	size := m.Size()
   291  	dAtA = make([]byte, size)
   292  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
   293  	if err != nil {
   294  		return nil, err
   295  	}
   296  	return dAtA[:n], nil
   297  }
   298  
   299  func (m *P4RoleConfig_PacketFilter) MarshalTo(dAtA []byte) (int, error) {
   300  	size := m.Size()
   301  	return m.MarshalToSizedBuffer(dAtA[:size])
   302  }
   303  
   304  func (m *P4RoleConfig_PacketFilter) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   305  	i := len(dAtA)
   306  	_ = i
   307  	var l int
   308  	_ = l
   309  	if len(m.Value) > 0 {
   310  		i -= len(m.Value)
   311  		copy(dAtA[i:], m.Value)
   312  		i = encodeVarintP4RoleConfig(dAtA, i, uint64(len(m.Value)))
   313  		i--
   314  		dAtA[i] = 0x12
   315  	}
   316  	if m.MetadataId != 0 {
   317  		i = encodeVarintP4RoleConfig(dAtA, i, uint64(m.MetadataId))
   318  		i--
   319  		dAtA[i] = 0x8
   320  	}
   321  	return len(dAtA) - i, nil
   322  }
   323  
   324  func encodeVarintP4RoleConfig(dAtA []byte, offset int, v uint64) int {
   325  	offset -= sovP4RoleConfig(v)
   326  	base := offset
   327  	for v >= 1<<7 {
   328  		dAtA[offset] = uint8(v&0x7f | 0x80)
   329  		v >>= 7
   330  		offset++
   331  	}
   332  	dAtA[offset] = uint8(v)
   333  	return base
   334  }
   335  func (m *P4RoleConfig) Size() (n int) {
   336  	if m == nil {
   337  		return 0
   338  	}
   339  	var l int
   340  	_ = l
   341  	if len(m.ExclusiveP4Ids) > 0 {
   342  		l = 0
   343  		for _, e := range m.ExclusiveP4Ids {
   344  			l += sovP4RoleConfig(uint64(e))
   345  		}
   346  		n += 1 + sovP4RoleConfig(uint64(l)) + l
   347  	}
   348  	if len(m.SharedP4Ids) > 0 {
   349  		l = 0
   350  		for _, e := range m.SharedP4Ids {
   351  			l += sovP4RoleConfig(uint64(e))
   352  		}
   353  		n += 1 + sovP4RoleConfig(uint64(l)) + l
   354  	}
   355  	if m.PacketInFilter != nil {
   356  		l = m.PacketInFilter.Size()
   357  		n += 1 + l + sovP4RoleConfig(uint64(l))
   358  	}
   359  	if m.ReceivesPacketIns {
   360  		n += 2
   361  	}
   362  	if m.CanPushPipeline {
   363  		n += 2
   364  	}
   365  	return n
   366  }
   367  
   368  func (m *P4RoleConfig_PacketFilter) Size() (n int) {
   369  	if m == nil {
   370  		return 0
   371  	}
   372  	var l int
   373  	_ = l
   374  	if m.MetadataId != 0 {
   375  		n += 1 + sovP4RoleConfig(uint64(m.MetadataId))
   376  	}
   377  	l = len(m.Value)
   378  	if l > 0 {
   379  		n += 1 + l + sovP4RoleConfig(uint64(l))
   380  	}
   381  	return n
   382  }
   383  
   384  func sovP4RoleConfig(x uint64) (n int) {
   385  	return (math_bits.Len64(x|1) + 6) / 7
   386  }
   387  func sozP4RoleConfig(x uint64) (n int) {
   388  	return sovP4RoleConfig(uint64((x << 1) ^ uint64((int64(x) >> 63))))
   389  }
   390  func (m *P4RoleConfig) Unmarshal(dAtA []byte) error {
   391  	l := len(dAtA)
   392  	iNdEx := 0
   393  	for iNdEx < l {
   394  		preIndex := iNdEx
   395  		var wire uint64
   396  		for shift := uint(0); ; shift += 7 {
   397  			if shift >= 64 {
   398  				return ErrIntOverflowP4RoleConfig
   399  			}
   400  			if iNdEx >= l {
   401  				return io.ErrUnexpectedEOF
   402  			}
   403  			b := dAtA[iNdEx]
   404  			iNdEx++
   405  			wire |= uint64(b&0x7F) << shift
   406  			if b < 0x80 {
   407  				break
   408  			}
   409  		}
   410  		fieldNum := int32(wire >> 3)
   411  		wireType := int(wire & 0x7)
   412  		if wireType == 4 {
   413  			return fmt.Errorf("proto: P4RoleConfig: wiretype end group for non-group")
   414  		}
   415  		if fieldNum <= 0 {
   416  			return fmt.Errorf("proto: P4RoleConfig: illegal tag %d (wire type %d)", fieldNum, wire)
   417  		}
   418  		switch fieldNum {
   419  		case 1:
   420  			if wireType == 0 {
   421  				var v uint32
   422  				for shift := uint(0); ; shift += 7 {
   423  					if shift >= 64 {
   424  						return ErrIntOverflowP4RoleConfig
   425  					}
   426  					if iNdEx >= l {
   427  						return io.ErrUnexpectedEOF
   428  					}
   429  					b := dAtA[iNdEx]
   430  					iNdEx++
   431  					v |= uint32(b&0x7F) << shift
   432  					if b < 0x80 {
   433  						break
   434  					}
   435  				}
   436  				m.ExclusiveP4Ids = append(m.ExclusiveP4Ids, v)
   437  			} else if wireType == 2 {
   438  				var packedLen int
   439  				for shift := uint(0); ; shift += 7 {
   440  					if shift >= 64 {
   441  						return ErrIntOverflowP4RoleConfig
   442  					}
   443  					if iNdEx >= l {
   444  						return io.ErrUnexpectedEOF
   445  					}
   446  					b := dAtA[iNdEx]
   447  					iNdEx++
   448  					packedLen |= int(b&0x7F) << shift
   449  					if b < 0x80 {
   450  						break
   451  					}
   452  				}
   453  				if packedLen < 0 {
   454  					return ErrInvalidLengthP4RoleConfig
   455  				}
   456  				postIndex := iNdEx + packedLen
   457  				if postIndex < 0 {
   458  					return ErrInvalidLengthP4RoleConfig
   459  				}
   460  				if postIndex > l {
   461  					return io.ErrUnexpectedEOF
   462  				}
   463  				var elementCount int
   464  				var count int
   465  				for _, integer := range dAtA[iNdEx:postIndex] {
   466  					if integer < 128 {
   467  						count++
   468  					}
   469  				}
   470  				elementCount = count
   471  				if elementCount != 0 && len(m.ExclusiveP4Ids) == 0 {
   472  					m.ExclusiveP4Ids = make([]uint32, 0, elementCount)
   473  				}
   474  				for iNdEx < postIndex {
   475  					var v uint32
   476  					for shift := uint(0); ; shift += 7 {
   477  						if shift >= 64 {
   478  							return ErrIntOverflowP4RoleConfig
   479  						}
   480  						if iNdEx >= l {
   481  							return io.ErrUnexpectedEOF
   482  						}
   483  						b := dAtA[iNdEx]
   484  						iNdEx++
   485  						v |= uint32(b&0x7F) << shift
   486  						if b < 0x80 {
   487  							break
   488  						}
   489  					}
   490  					m.ExclusiveP4Ids = append(m.ExclusiveP4Ids, v)
   491  				}
   492  			} else {
   493  				return fmt.Errorf("proto: wrong wireType = %d for field ExclusiveP4Ids", wireType)
   494  			}
   495  		case 2:
   496  			if wireType == 0 {
   497  				var v uint32
   498  				for shift := uint(0); ; shift += 7 {
   499  					if shift >= 64 {
   500  						return ErrIntOverflowP4RoleConfig
   501  					}
   502  					if iNdEx >= l {
   503  						return io.ErrUnexpectedEOF
   504  					}
   505  					b := dAtA[iNdEx]
   506  					iNdEx++
   507  					v |= uint32(b&0x7F) << shift
   508  					if b < 0x80 {
   509  						break
   510  					}
   511  				}
   512  				m.SharedP4Ids = append(m.SharedP4Ids, v)
   513  			} else if wireType == 2 {
   514  				var packedLen int
   515  				for shift := uint(0); ; shift += 7 {
   516  					if shift >= 64 {
   517  						return ErrIntOverflowP4RoleConfig
   518  					}
   519  					if iNdEx >= l {
   520  						return io.ErrUnexpectedEOF
   521  					}
   522  					b := dAtA[iNdEx]
   523  					iNdEx++
   524  					packedLen |= int(b&0x7F) << shift
   525  					if b < 0x80 {
   526  						break
   527  					}
   528  				}
   529  				if packedLen < 0 {
   530  					return ErrInvalidLengthP4RoleConfig
   531  				}
   532  				postIndex := iNdEx + packedLen
   533  				if postIndex < 0 {
   534  					return ErrInvalidLengthP4RoleConfig
   535  				}
   536  				if postIndex > l {
   537  					return io.ErrUnexpectedEOF
   538  				}
   539  				var elementCount int
   540  				var count int
   541  				for _, integer := range dAtA[iNdEx:postIndex] {
   542  					if integer < 128 {
   543  						count++
   544  					}
   545  				}
   546  				elementCount = count
   547  				if elementCount != 0 && len(m.SharedP4Ids) == 0 {
   548  					m.SharedP4Ids = make([]uint32, 0, elementCount)
   549  				}
   550  				for iNdEx < postIndex {
   551  					var v uint32
   552  					for shift := uint(0); ; shift += 7 {
   553  						if shift >= 64 {
   554  							return ErrIntOverflowP4RoleConfig
   555  						}
   556  						if iNdEx >= l {
   557  							return io.ErrUnexpectedEOF
   558  						}
   559  						b := dAtA[iNdEx]
   560  						iNdEx++
   561  						v |= uint32(b&0x7F) << shift
   562  						if b < 0x80 {
   563  							break
   564  						}
   565  					}
   566  					m.SharedP4Ids = append(m.SharedP4Ids, v)
   567  				}
   568  			} else {
   569  				return fmt.Errorf("proto: wrong wireType = %d for field SharedP4Ids", wireType)
   570  			}
   571  		case 3:
   572  			if wireType != 2 {
   573  				return fmt.Errorf("proto: wrong wireType = %d for field PacketInFilter", wireType)
   574  			}
   575  			var msglen int
   576  			for shift := uint(0); ; shift += 7 {
   577  				if shift >= 64 {
   578  					return ErrIntOverflowP4RoleConfig
   579  				}
   580  				if iNdEx >= l {
   581  					return io.ErrUnexpectedEOF
   582  				}
   583  				b := dAtA[iNdEx]
   584  				iNdEx++
   585  				msglen |= int(b&0x7F) << shift
   586  				if b < 0x80 {
   587  					break
   588  				}
   589  			}
   590  			if msglen < 0 {
   591  				return ErrInvalidLengthP4RoleConfig
   592  			}
   593  			postIndex := iNdEx + msglen
   594  			if postIndex < 0 {
   595  				return ErrInvalidLengthP4RoleConfig
   596  			}
   597  			if postIndex > l {
   598  				return io.ErrUnexpectedEOF
   599  			}
   600  			if m.PacketInFilter == nil {
   601  				m.PacketInFilter = &P4RoleConfig_PacketFilter{}
   602  			}
   603  			if err := m.PacketInFilter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
   604  				return err
   605  			}
   606  			iNdEx = postIndex
   607  		case 4:
   608  			if wireType != 0 {
   609  				return fmt.Errorf("proto: wrong wireType = %d for field ReceivesPacketIns", wireType)
   610  			}
   611  			var v int
   612  			for shift := uint(0); ; shift += 7 {
   613  				if shift >= 64 {
   614  					return ErrIntOverflowP4RoleConfig
   615  				}
   616  				if iNdEx >= l {
   617  					return io.ErrUnexpectedEOF
   618  				}
   619  				b := dAtA[iNdEx]
   620  				iNdEx++
   621  				v |= int(b&0x7F) << shift
   622  				if b < 0x80 {
   623  					break
   624  				}
   625  			}
   626  			m.ReceivesPacketIns = bool(v != 0)
   627  		case 5:
   628  			if wireType != 0 {
   629  				return fmt.Errorf("proto: wrong wireType = %d for field CanPushPipeline", wireType)
   630  			}
   631  			var v int
   632  			for shift := uint(0); ; shift += 7 {
   633  				if shift >= 64 {
   634  					return ErrIntOverflowP4RoleConfig
   635  				}
   636  				if iNdEx >= l {
   637  					return io.ErrUnexpectedEOF
   638  				}
   639  				b := dAtA[iNdEx]
   640  				iNdEx++
   641  				v |= int(b&0x7F) << shift
   642  				if b < 0x80 {
   643  					break
   644  				}
   645  			}
   646  			m.CanPushPipeline = bool(v != 0)
   647  		default:
   648  			iNdEx = preIndex
   649  			skippy, err := skipP4RoleConfig(dAtA[iNdEx:])
   650  			if err != nil {
   651  				return err
   652  			}
   653  			if (skippy < 0) || (iNdEx+skippy) < 0 {
   654  				return ErrInvalidLengthP4RoleConfig
   655  			}
   656  			if (iNdEx + skippy) > l {
   657  				return io.ErrUnexpectedEOF
   658  			}
   659  			iNdEx += skippy
   660  		}
   661  	}
   662  
   663  	if iNdEx > l {
   664  		return io.ErrUnexpectedEOF
   665  	}
   666  	return nil
   667  }
   668  func (m *P4RoleConfig_PacketFilter) Unmarshal(dAtA []byte) error {
   669  	l := len(dAtA)
   670  	iNdEx := 0
   671  	for iNdEx < l {
   672  		preIndex := iNdEx
   673  		var wire uint64
   674  		for shift := uint(0); ; shift += 7 {
   675  			if shift >= 64 {
   676  				return ErrIntOverflowP4RoleConfig
   677  			}
   678  			if iNdEx >= l {
   679  				return io.ErrUnexpectedEOF
   680  			}
   681  			b := dAtA[iNdEx]
   682  			iNdEx++
   683  			wire |= uint64(b&0x7F) << shift
   684  			if b < 0x80 {
   685  				break
   686  			}
   687  		}
   688  		fieldNum := int32(wire >> 3)
   689  		wireType := int(wire & 0x7)
   690  		if wireType == 4 {
   691  			return fmt.Errorf("proto: PacketFilter: wiretype end group for non-group")
   692  		}
   693  		if fieldNum <= 0 {
   694  			return fmt.Errorf("proto: PacketFilter: illegal tag %d (wire type %d)", fieldNum, wire)
   695  		}
   696  		switch fieldNum {
   697  		case 1:
   698  			if wireType != 0 {
   699  				return fmt.Errorf("proto: wrong wireType = %d for field MetadataId", wireType)
   700  			}
   701  			m.MetadataId = 0
   702  			for shift := uint(0); ; shift += 7 {
   703  				if shift >= 64 {
   704  					return ErrIntOverflowP4RoleConfig
   705  				}
   706  				if iNdEx >= l {
   707  					return io.ErrUnexpectedEOF
   708  				}
   709  				b := dAtA[iNdEx]
   710  				iNdEx++
   711  				m.MetadataId |= uint32(b&0x7F) << shift
   712  				if b < 0x80 {
   713  					break
   714  				}
   715  			}
   716  		case 2:
   717  			if wireType != 2 {
   718  				return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType)
   719  			}
   720  			var byteLen int
   721  			for shift := uint(0); ; shift += 7 {
   722  				if shift >= 64 {
   723  					return ErrIntOverflowP4RoleConfig
   724  				}
   725  				if iNdEx >= l {
   726  					return io.ErrUnexpectedEOF
   727  				}
   728  				b := dAtA[iNdEx]
   729  				iNdEx++
   730  				byteLen |= int(b&0x7F) << shift
   731  				if b < 0x80 {
   732  					break
   733  				}
   734  			}
   735  			if byteLen < 0 {
   736  				return ErrInvalidLengthP4RoleConfig
   737  			}
   738  			postIndex := iNdEx + byteLen
   739  			if postIndex < 0 {
   740  				return ErrInvalidLengthP4RoleConfig
   741  			}
   742  			if postIndex > l {
   743  				return io.ErrUnexpectedEOF
   744  			}
   745  			m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...)
   746  			if m.Value == nil {
   747  				m.Value = []byte{}
   748  			}
   749  			iNdEx = postIndex
   750  		default:
   751  			iNdEx = preIndex
   752  			skippy, err := skipP4RoleConfig(dAtA[iNdEx:])
   753  			if err != nil {
   754  				return err
   755  			}
   756  			if (skippy < 0) || (iNdEx+skippy) < 0 {
   757  				return ErrInvalidLengthP4RoleConfig
   758  			}
   759  			if (iNdEx + skippy) > l {
   760  				return io.ErrUnexpectedEOF
   761  			}
   762  			iNdEx += skippy
   763  		}
   764  	}
   765  
   766  	if iNdEx > l {
   767  		return io.ErrUnexpectedEOF
   768  	}
   769  	return nil
   770  }
   771  func skipP4RoleConfig(dAtA []byte) (n int, err error) {
   772  	l := len(dAtA)
   773  	iNdEx := 0
   774  	depth := 0
   775  	for iNdEx < l {
   776  		var wire uint64
   777  		for shift := uint(0); ; shift += 7 {
   778  			if shift >= 64 {
   779  				return 0, ErrIntOverflowP4RoleConfig
   780  			}
   781  			if iNdEx >= l {
   782  				return 0, io.ErrUnexpectedEOF
   783  			}
   784  			b := dAtA[iNdEx]
   785  			iNdEx++
   786  			wire |= (uint64(b) & 0x7F) << shift
   787  			if b < 0x80 {
   788  				break
   789  			}
   790  		}
   791  		wireType := int(wire & 0x7)
   792  		switch wireType {
   793  		case 0:
   794  			for shift := uint(0); ; shift += 7 {
   795  				if shift >= 64 {
   796  					return 0, ErrIntOverflowP4RoleConfig
   797  				}
   798  				if iNdEx >= l {
   799  					return 0, io.ErrUnexpectedEOF
   800  				}
   801  				iNdEx++
   802  				if dAtA[iNdEx-1] < 0x80 {
   803  					break
   804  				}
   805  			}
   806  		case 1:
   807  			iNdEx += 8
   808  		case 2:
   809  			var length int
   810  			for shift := uint(0); ; shift += 7 {
   811  				if shift >= 64 {
   812  					return 0, ErrIntOverflowP4RoleConfig
   813  				}
   814  				if iNdEx >= l {
   815  					return 0, io.ErrUnexpectedEOF
   816  				}
   817  				b := dAtA[iNdEx]
   818  				iNdEx++
   819  				length |= (int(b) & 0x7F) << shift
   820  				if b < 0x80 {
   821  					break
   822  				}
   823  			}
   824  			if length < 0 {
   825  				return 0, ErrInvalidLengthP4RoleConfig
   826  			}
   827  			iNdEx += length
   828  		case 3:
   829  			depth++
   830  		case 4:
   831  			if depth == 0 {
   832  				return 0, ErrUnexpectedEndOfGroupP4RoleConfig
   833  			}
   834  			depth--
   835  		case 5:
   836  			iNdEx += 4
   837  		default:
   838  			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
   839  		}
   840  		if iNdEx < 0 {
   841  			return 0, ErrInvalidLengthP4RoleConfig
   842  		}
   843  		if depth == 0 {
   844  			return iNdEx, nil
   845  		}
   846  	}
   847  	return 0, io.ErrUnexpectedEOF
   848  }
   849  
   850  var (
   851  	ErrInvalidLengthP4RoleConfig        = fmt.Errorf("proto: negative length found during unmarshaling")
   852  	ErrIntOverflowP4RoleConfig          = fmt.Errorf("proto: integer overflow")
   853  	ErrUnexpectedEndOfGroupP4RoleConfig = fmt.Errorf("proto: unexpected end of group")
   854  )