address.pb.go 4.9 KB

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