address.pb.go 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. package net
  2. import (
  3. fmt "fmt"
  4. proto "github.com/golang/protobuf/proto"
  5. math "math"
  6. )
  7. // Reference imports to suppress errors if they are not otherwise used.
  8. var _ = proto.Marshal
  9. var _ = fmt.Errorf
  10. var _ = math.Inf
  11. // This is a compile-time assertion to ensure that this generated file
  12. // is compatible with the proto package it is being compiled against.
  13. // A compilation error at this line likely means your copy of the
  14. // proto package needs to be updated.
  15. const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
  16. // Address of a network host. It may be either an IP address or a domain address.
  17. type IPOrDomain struct {
  18. // Types that are valid to be assigned to Address:
  19. // *IPOrDomain_Ip
  20. // *IPOrDomain_Domain
  21. Address isIPOrDomain_Address `protobuf_oneof:"address"`
  22. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  23. XXX_unrecognized []byte `json:"-"`
  24. XXX_sizecache int32 `json:"-"`
  25. }
  26. func (m *IPOrDomain) Reset() { *m = IPOrDomain{} }
  27. func (m *IPOrDomain) String() string { return proto.CompactTextString(m) }
  28. func (*IPOrDomain) ProtoMessage() {}
  29. func (*IPOrDomain) Descriptor() ([]byte, []int) {
  30. return fileDescriptor_4ba9b4a4304e7c1f, []int{0}
  31. }
  32. func (m *IPOrDomain) XXX_Unmarshal(b []byte) error {
  33. return xxx_messageInfo_IPOrDomain.Unmarshal(m, b)
  34. }
  35. func (m *IPOrDomain) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  36. return xxx_messageInfo_IPOrDomain.Marshal(b, m, deterministic)
  37. }
  38. func (m *IPOrDomain) XXX_Merge(src proto.Message) {
  39. xxx_messageInfo_IPOrDomain.Merge(m, src)
  40. }
  41. func (m *IPOrDomain) XXX_Size() int {
  42. return xxx_messageInfo_IPOrDomain.Size(m)
  43. }
  44. func (m *IPOrDomain) XXX_DiscardUnknown() {
  45. xxx_messageInfo_IPOrDomain.DiscardUnknown(m)
  46. }
  47. var xxx_messageInfo_IPOrDomain proto.InternalMessageInfo
  48. type isIPOrDomain_Address interface {
  49. isIPOrDomain_Address()
  50. }
  51. type IPOrDomain_Ip struct {
  52. Ip []byte `protobuf:"bytes,1,opt,name=ip,proto3,oneof"`
  53. }
  54. type IPOrDomain_Domain struct {
  55. Domain string `protobuf:"bytes,2,opt,name=domain,proto3,oneof"`
  56. }
  57. func (*IPOrDomain_Ip) isIPOrDomain_Address() {}
  58. func (*IPOrDomain_Domain) isIPOrDomain_Address() {}
  59. func (m *IPOrDomain) GetAddress() isIPOrDomain_Address {
  60. if m != nil {
  61. return m.Address
  62. }
  63. return nil
  64. }
  65. func (m *IPOrDomain) GetIp() []byte {
  66. if x, ok := m.GetAddress().(*IPOrDomain_Ip); ok {
  67. return x.Ip
  68. }
  69. return nil
  70. }
  71. func (m *IPOrDomain) GetDomain() string {
  72. if x, ok := m.GetAddress().(*IPOrDomain_Domain); ok {
  73. return x.Domain
  74. }
  75. return ""
  76. }
  77. // XXX_OneofFuncs is for the internal use of the proto package.
  78. func (*IPOrDomain) 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{}) {
  79. return _IPOrDomain_OneofMarshaler, _IPOrDomain_OneofUnmarshaler, _IPOrDomain_OneofSizer, []interface{}{
  80. (*IPOrDomain_Ip)(nil),
  81. (*IPOrDomain_Domain)(nil),
  82. }
  83. }
  84. func _IPOrDomain_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
  85. m := msg.(*IPOrDomain)
  86. // address
  87. switch x := m.Address.(type) {
  88. case *IPOrDomain_Ip:
  89. b.EncodeVarint(1<<3 | proto.WireBytes)
  90. b.EncodeRawBytes(x.Ip)
  91. case *IPOrDomain_Domain:
  92. b.EncodeVarint(2<<3 | proto.WireBytes)
  93. b.EncodeStringBytes(x.Domain)
  94. case nil:
  95. default:
  96. return fmt.Errorf("IPOrDomain.Address has unexpected type %T", x)
  97. }
  98. return nil
  99. }
  100. func _IPOrDomain_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
  101. m := msg.(*IPOrDomain)
  102. switch tag {
  103. case 1: // address.ip
  104. if wire != proto.WireBytes {
  105. return true, proto.ErrInternalBadWireType
  106. }
  107. x, err := b.DecodeRawBytes(true)
  108. m.Address = &IPOrDomain_Ip{x}
  109. return true, err
  110. case 2: // address.domain
  111. if wire != proto.WireBytes {
  112. return true, proto.ErrInternalBadWireType
  113. }
  114. x, err := b.DecodeStringBytes()
  115. m.Address = &IPOrDomain_Domain{x}
  116. return true, err
  117. default:
  118. return false, nil
  119. }
  120. }
  121. func _IPOrDomain_OneofSizer(msg proto.Message) (n int) {
  122. m := msg.(*IPOrDomain)
  123. // address
  124. switch x := m.Address.(type) {
  125. case *IPOrDomain_Ip:
  126. n += 1 // tag and wire
  127. n += proto.SizeVarint(uint64(len(x.Ip)))
  128. n += len(x.Ip)
  129. case *IPOrDomain_Domain:
  130. n += 1 // tag and wire
  131. n += proto.SizeVarint(uint64(len(x.Domain)))
  132. n += len(x.Domain)
  133. case nil:
  134. default:
  135. panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
  136. }
  137. return n
  138. }
  139. func init() {
  140. proto.RegisterType((*IPOrDomain)(nil), "v2ray.core.common.net.IPOrDomain")
  141. }
  142. func init() {
  143. proto.RegisterFile("v2ray.com/core/common/net/address.proto", fileDescriptor_4ba9b4a4304e7c1f)
  144. }
  145. var fileDescriptor_4ba9b4a4304e7c1f = []byte{
  146. // 174 bytes of a gzipped FileDescriptorProto
  147. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x2f, 0x33, 0x2a, 0x4a,
  148. 0xac, 0xd4, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xce, 0x2f, 0x4a, 0xd5, 0x4f, 0xce, 0xcf, 0xcd, 0xcd,
  149. 0xcf, 0xd3, 0xcf, 0x4b, 0x2d, 0xd1, 0x4f, 0x4c, 0x49, 0x29, 0x4a, 0x2d, 0x2e, 0xd6, 0x2b, 0x28,
  150. 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x85, 0x29, 0x2c, 0x4a, 0xd5, 0x83, 0x28, 0xd2, 0xcb, 0x4b, 0x2d,
  151. 0x51, 0x72, 0xe6, 0xe2, 0xf2, 0x0c, 0xf0, 0x2f, 0x72, 0xc9, 0xcf, 0x4d, 0xcc, 0xcc, 0x13, 0x12,
  152. 0xe0, 0x62, 0xca, 0x2c, 0x90, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0xf1, 0x60, 0x08, 0x62, 0xca, 0x2c,
  153. 0x10, 0x92, 0xe0, 0x62, 0x4b, 0x01, 0xcb, 0x49, 0x30, 0x29, 0x30, 0x6a, 0x70, 0x7a, 0x30, 0x04,
  154. 0x41, 0xf9, 0x4e, 0x9c, 0x5c, 0xec, 0x50, 0x1b, 0x9c, 0xac, 0xb8, 0x24, 0x93, 0xf3, 0x73, 0xf5,
  155. 0xb0, 0xda, 0x10, 0xc0, 0x18, 0xc5, 0x9c, 0x97, 0x5a, 0xb2, 0x8a, 0x49, 0x34, 0xcc, 0x28, 0x28,
  156. 0xb1, 0x52, 0xcf, 0x19, 0x24, 0xed, 0x0c, 0x91, 0xf6, 0x4b, 0x2d, 0x49, 0x62, 0x03, 0x3b, 0xcf,
  157. 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0xc9, 0xb4, 0xfa, 0x61, 0xc9, 0x00, 0x00, 0x00,
  158. }