address.pb.go 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. // Code generated by protoc-gen-go.
  2. // source: v2ray.com/core/common/net/address.proto
  3. // DO NOT EDIT!
  4. /*
  5. Package net is a generated protocol buffer package.
  6. It is generated from these files:
  7. v2ray.com/core/common/net/address.proto
  8. v2ray.com/core/common/net/destination.proto
  9. v2ray.com/core/common/net/network.proto
  10. v2ray.com/core/common/net/port.proto
  11. It has these top-level messages:
  12. AddressPB
  13. DestinationPB
  14. NetworkList
  15. PortRange
  16. */
  17. package net
  18. import proto "github.com/golang/protobuf/proto"
  19. import fmt "fmt"
  20. import math "math"
  21. // Reference imports to suppress errors if they are not otherwise used.
  22. var _ = proto.Marshal
  23. var _ = fmt.Errorf
  24. var _ = math.Inf
  25. // This is a compile-time assertion to ensure that this generated file
  26. // is compatible with the proto package it is being compiled against.
  27. // A compilation error at this line likely means your copy of the
  28. // proto package needs to be updated.
  29. const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
  30. type AddressPB struct {
  31. // Types that are valid to be assigned to Address:
  32. // *AddressPB_Ip
  33. // *AddressPB_Domain
  34. Address isAddressPB_Address `protobuf_oneof:"address"`
  35. }
  36. func (m *AddressPB) Reset() { *m = AddressPB{} }
  37. func (m *AddressPB) String() string { return proto.CompactTextString(m) }
  38. func (*AddressPB) ProtoMessage() {}
  39. func (*AddressPB) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
  40. type isAddressPB_Address interface {
  41. isAddressPB_Address()
  42. }
  43. type AddressPB_Ip struct {
  44. Ip []byte `protobuf:"bytes,1,opt,name=ip,proto3,oneof"`
  45. }
  46. type AddressPB_Domain struct {
  47. Domain string `protobuf:"bytes,2,opt,name=domain,oneof"`
  48. }
  49. func (*AddressPB_Ip) isAddressPB_Address() {}
  50. func (*AddressPB_Domain) isAddressPB_Address() {}
  51. func (m *AddressPB) GetAddress() isAddressPB_Address {
  52. if m != nil {
  53. return m.Address
  54. }
  55. return nil
  56. }
  57. func (m *AddressPB) GetIp() []byte {
  58. if x, ok := m.GetAddress().(*AddressPB_Ip); ok {
  59. return x.Ip
  60. }
  61. return nil
  62. }
  63. func (m *AddressPB) GetDomain() string {
  64. if x, ok := m.GetAddress().(*AddressPB_Domain); ok {
  65. return x.Domain
  66. }
  67. return ""
  68. }
  69. // XXX_OneofFuncs is for the internal use of the proto package.
  70. func (*AddressPB) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
  71. return _AddressPB_OneofMarshaler, _AddressPB_OneofUnmarshaler, _AddressPB_OneofSizer, []interface{}{
  72. (*AddressPB_Ip)(nil),
  73. (*AddressPB_Domain)(nil),
  74. }
  75. }
  76. func _AddressPB_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
  77. m := msg.(*AddressPB)
  78. // address
  79. switch x := m.Address.(type) {
  80. case *AddressPB_Ip:
  81. b.EncodeVarint(1<<3 | proto.WireBytes)
  82. b.EncodeRawBytes(x.Ip)
  83. case *AddressPB_Domain:
  84. b.EncodeVarint(2<<3 | proto.WireBytes)
  85. b.EncodeStringBytes(x.Domain)
  86. case nil:
  87. default:
  88. return fmt.Errorf("AddressPB.Address has unexpected type %T", x)
  89. }
  90. return nil
  91. }
  92. func _AddressPB_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
  93. m := msg.(*AddressPB)
  94. switch tag {
  95. case 1: // address.ip
  96. if wire != proto.WireBytes {
  97. return true, proto.ErrInternalBadWireType
  98. }
  99. x, err := b.DecodeRawBytes(true)
  100. m.Address = &AddressPB_Ip{x}
  101. return true, err
  102. case 2: // address.domain
  103. if wire != proto.WireBytes {
  104. return true, proto.ErrInternalBadWireType
  105. }
  106. x, err := b.DecodeStringBytes()
  107. m.Address = &AddressPB_Domain{x}
  108. return true, err
  109. default:
  110. return false, nil
  111. }
  112. }
  113. func _AddressPB_OneofSizer(msg proto.Message) (n int) {
  114. m := msg.(*AddressPB)
  115. // address
  116. switch x := m.Address.(type) {
  117. case *AddressPB_Ip:
  118. n += proto.SizeVarint(1<<3 | proto.WireBytes)
  119. n += proto.SizeVarint(uint64(len(x.Ip)))
  120. n += len(x.Ip)
  121. case *AddressPB_Domain:
  122. n += proto.SizeVarint(2<<3 | proto.WireBytes)
  123. n += proto.SizeVarint(uint64(len(x.Domain)))
  124. n += len(x.Domain)
  125. case nil:
  126. default:
  127. panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
  128. }
  129. return n
  130. }
  131. func init() {
  132. proto.RegisterType((*AddressPB)(nil), "v2ray.core.common.net.AddressPB")
  133. }
  134. func init() { proto.RegisterFile("v2ray.com/core/common/net/address.proto", fileDescriptor0) }
  135. var fileDescriptor0 = []byte{
  136. // 159 bytes of a gzipped FileDescriptorProto
  137. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0x52, 0x2f, 0x33, 0x2a, 0x4a,
  138. 0xac, 0xd4, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xce, 0x2f, 0x4a, 0xd5, 0x4f, 0xce, 0xcf, 0xcd, 0xcd,
  139. 0xcf, 0xd3, 0xcf, 0x4b, 0x2d, 0xd1, 0x4f, 0x4c, 0x49, 0x29, 0x4a, 0x2d, 0x2e, 0xd6, 0x2b, 0x28,
  140. 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x85, 0x29, 0x2c, 0x4a, 0xd5, 0x83, 0x28, 0xd2, 0xcb, 0x4b, 0x2d,
  141. 0x51, 0x72, 0xe2, 0xe2, 0x74, 0x84, 0xa8, 0x0b, 0x70, 0x12, 0x12, 0xe0, 0x62, 0xca, 0x2c, 0x90,
  142. 0x60, 0x54, 0x60, 0xd4, 0xe0, 0xf1, 0x60, 0x08, 0x62, 0xca, 0x2c, 0x10, 0x92, 0xe0, 0x62, 0x4b,
  143. 0xc9, 0xcf, 0x4d, 0xcc, 0xcc, 0x93, 0x60, 0x52, 0x60, 0xd4, 0xe0, 0xf4, 0x60, 0x08, 0x82, 0xf2,
  144. 0x9d, 0x38, 0xb9, 0xd8, 0xa1, 0x16, 0x38, 0xe9, 0x71, 0x49, 0x26, 0xe7, 0xe7, 0xea, 0x61, 0xb5,
  145. 0xc0, 0x89, 0x07, 0x66, 0x3c, 0xc8, 0x15, 0x51, 0xcc, 0x79, 0xa9, 0x25, 0x49, 0x6c, 0x60, 0x17,
  146. 0x19, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0xa1, 0xd1, 0xe6, 0x14, 0xbc, 0x00, 0x00, 0x00,
  147. }