fix proto
This commit is contained in:
parent
b5a20d12c9
commit
092959f665
@ -260,56 +260,165 @@ struct SDLPolicyResponse: @unchecked Sendable {
|
|||||||
init() {}
|
init() {}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct SDLNatChangedEvent: @unchecked Sendable {
|
struct SDLEvent: Sendable {
|
||||||
// SwiftProtobuf.Message conformance is added in an extension below. See the
|
// SwiftProtobuf.Message conformance is added in an extension below. See the
|
||||||
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
|
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
|
||||||
// methods supported on all messages.
|
// methods supported on all messages.
|
||||||
|
|
||||||
var mac: Data = Data()
|
var event: SDLEvent.OneOf_Event? = nil
|
||||||
|
|
||||||
var ip: UInt32 = 0
|
var natChanged: SDLEvent.NatChanged {
|
||||||
|
get {
|
||||||
var unknownFields = SwiftProtobuf.UnknownStorage()
|
if case .natChanged(let v)? = event {return v}
|
||||||
|
return SDLEvent.NatChanged()
|
||||||
init() {}
|
}
|
||||||
}
|
set {event = .natChanged(newValue)}
|
||||||
|
}
|
||||||
struct SDLSendRegisterEvent: @unchecked Sendable {
|
|
||||||
// SwiftProtobuf.Message conformance is added in an extension below. See the
|
var sendRegister: SDLEvent.SendRegister {
|
||||||
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
|
get {
|
||||||
// methods supported on all messages.
|
if case .sendRegister(let v)? = event {return v}
|
||||||
|
return SDLEvent.SendRegister()
|
||||||
var dstMac: Data = Data()
|
}
|
||||||
|
set {event = .sendRegister(newValue)}
|
||||||
var natIp: UInt32 = 0
|
}
|
||||||
|
|
||||||
var natPort: UInt32 = 0
|
var shutdown: SDLEvent.NetworkShutdown {
|
||||||
|
get {
|
||||||
var natType: UInt32 = 0
|
if case .shutdown(let v)? = event {return v}
|
||||||
|
return SDLEvent.NetworkShutdown()
|
||||||
var v6Info: SDLV6Info {
|
}
|
||||||
get {return _v6Info ?? SDLV6Info()}
|
set {event = .shutdown(newValue)}
|
||||||
set {_v6Info = newValue}
|
|
||||||
}
|
}
|
||||||
/// Returns true if `v6Info` has been explicitly set.
|
|
||||||
var hasV6Info: Bool {return self._v6Info != nil}
|
|
||||||
/// Clears the value of `v6Info`. Subsequent reads from it will return its default value.
|
|
||||||
mutating func clearV6Info() {self._v6Info = nil}
|
|
||||||
|
|
||||||
var unknownFields = SwiftProtobuf.UnknownStorage()
|
var unknownFields = SwiftProtobuf.UnknownStorage()
|
||||||
|
|
||||||
init() {}
|
enum OneOf_Event: Equatable, Sendable {
|
||||||
|
case natChanged(SDLEvent.NatChanged)
|
||||||
|
case sendRegister(SDLEvent.SendRegister)
|
||||||
|
case shutdown(SDLEvent.NetworkShutdown)
|
||||||
|
|
||||||
fileprivate var _v6Info: SDLV6Info? = nil
|
}
|
||||||
|
|
||||||
|
/// nat映射变化
|
||||||
|
struct NatChanged: @unchecked Sendable {
|
||||||
|
// SwiftProtobuf.Message conformance is added in an extension below. See the
|
||||||
|
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
|
||||||
|
// methods supported on all messages.
|
||||||
|
|
||||||
|
var mac: Data = Data()
|
||||||
|
|
||||||
|
var ip: UInt32 = 0
|
||||||
|
|
||||||
|
var unknownFields = SwiftProtobuf.UnknownStorage()
|
||||||
|
|
||||||
|
init() {}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 发送register消息
|
||||||
|
struct SendRegister: @unchecked Sendable {
|
||||||
|
// SwiftProtobuf.Message conformance is added in an extension below. See the
|
||||||
|
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
|
||||||
|
// methods supported on all messages.
|
||||||
|
|
||||||
|
var dstMac: Data = Data()
|
||||||
|
|
||||||
|
var natIp: UInt32 = 0
|
||||||
|
|
||||||
|
var natPort: UInt32 = 0
|
||||||
|
|
||||||
|
var natType: UInt32 = 0
|
||||||
|
|
||||||
|
var v6Info: SDLV6Info {
|
||||||
|
get {return _v6Info ?? SDLV6Info()}
|
||||||
|
set {_v6Info = newValue}
|
||||||
|
}
|
||||||
|
/// Returns true if `v6Info` has been explicitly set.
|
||||||
|
var hasV6Info: Bool {return self._v6Info != nil}
|
||||||
|
/// Clears the value of `v6Info`. Subsequent reads from it will return its default value.
|
||||||
|
mutating func clearV6Info() {self._v6Info = nil}
|
||||||
|
|
||||||
|
var unknownFields = SwiftProtobuf.UnknownStorage()
|
||||||
|
|
||||||
|
init() {}
|
||||||
|
|
||||||
|
fileprivate var _v6Info: SDLV6Info? = nil
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 网络关闭
|
||||||
|
struct NetworkShutdown: Sendable {
|
||||||
|
// SwiftProtobuf.Message conformance is added in an extension below. See the
|
||||||
|
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
|
||||||
|
// methods supported on all messages.
|
||||||
|
|
||||||
|
var message: String = String()
|
||||||
|
|
||||||
|
var unknownFields = SwiftProtobuf.UnknownStorage()
|
||||||
|
|
||||||
|
init() {}
|
||||||
|
}
|
||||||
|
|
||||||
|
init() {}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct SDLNetworkShutdownEvent: Sendable {
|
/// Command指令
|
||||||
|
struct SDLCommand: Sendable {
|
||||||
// SwiftProtobuf.Message conformance is added in an extension below. See the
|
// SwiftProtobuf.Message conformance is added in an extension below. See the
|
||||||
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
|
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
|
||||||
// methods supported on all messages.
|
// methods supported on all messages.
|
||||||
|
|
||||||
|
var pktID: UInt32 = 0
|
||||||
|
|
||||||
|
var command: SDLCommand.OneOf_Command? = nil
|
||||||
|
|
||||||
|
var exitNode: SDLCommand.ExitNodeControl {
|
||||||
|
get {
|
||||||
|
if case .exitNode(let v)? = command {return v}
|
||||||
|
return SDLCommand.ExitNodeControl()
|
||||||
|
}
|
||||||
|
set {command = .exitNode(newValue)}
|
||||||
|
}
|
||||||
|
|
||||||
|
var unknownFields = SwiftProtobuf.UnknownStorage()
|
||||||
|
|
||||||
|
enum OneOf_Command: Equatable, Sendable {
|
||||||
|
case exitNode(SDLCommand.ExitNodeControl)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 出口节点控制
|
||||||
|
struct ExitNodeControl: Sendable {
|
||||||
|
// SwiftProtobuf.Message conformance is added in an extension below. See the
|
||||||
|
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
|
||||||
|
// methods supported on all messages.
|
||||||
|
|
||||||
|
/// 必选:操作类型
|
||||||
|
var action: Int32 = 0
|
||||||
|
|
||||||
|
/// 可选:备注(方便日志/调试)
|
||||||
|
var remark: String = String()
|
||||||
|
|
||||||
|
var unknownFields = SwiftProtobuf.UnknownStorage()
|
||||||
|
|
||||||
|
init() {}
|
||||||
|
}
|
||||||
|
|
||||||
|
init() {}
|
||||||
|
}
|
||||||
|
|
||||||
|
struct SDLCommandAck: @unchecked Sendable {
|
||||||
|
// SwiftProtobuf.Message conformance is added in an extension below. See the
|
||||||
|
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
|
||||||
|
// methods supported on all messages.
|
||||||
|
|
||||||
|
var pktID: UInt32 = 0
|
||||||
|
|
||||||
|
var code: Int32 = 0
|
||||||
|
|
||||||
var message: String = String()
|
var message: String = String()
|
||||||
|
|
||||||
|
var data: Data = Data()
|
||||||
|
|
||||||
var unknownFields = SwiftProtobuf.UnknownStorage()
|
var unknownFields = SwiftProtobuf.UnknownStorage()
|
||||||
|
|
||||||
init() {}
|
init() {}
|
||||||
@ -1019,8 +1128,96 @@ extension SDLPolicyResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplem
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extension SDLNatChangedEvent: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
extension SDLEvent: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||||
static let protoMessageName: String = "SDLNatChangedEvent"
|
static let protoMessageName: String = "SDLEvent"
|
||||||
|
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||||
|
1: .standard(proto: "nat_changed"),
|
||||||
|
2: .standard(proto: "send_register"),
|
||||||
|
3: .same(proto: "shutdown"),
|
||||||
|
]
|
||||||
|
|
||||||
|
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
||||||
|
while let fieldNumber = try decoder.nextFieldNumber() {
|
||||||
|
// The use of inline closures is to circumvent an issue where the compiler
|
||||||
|
// allocates stack space for every case branch when no optimizations are
|
||||||
|
// enabled. https://github.com/apple/swift-protobuf/issues/1034
|
||||||
|
switch fieldNumber {
|
||||||
|
case 1: try {
|
||||||
|
var v: SDLEvent.NatChanged?
|
||||||
|
var hadOneofValue = false
|
||||||
|
if let current = self.event {
|
||||||
|
hadOneofValue = true
|
||||||
|
if case .natChanged(let m) = current {v = m}
|
||||||
|
}
|
||||||
|
try decoder.decodeSingularMessageField(value: &v)
|
||||||
|
if let v = v {
|
||||||
|
if hadOneofValue {try decoder.handleConflictingOneOf()}
|
||||||
|
self.event = .natChanged(v)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
case 2: try {
|
||||||
|
var v: SDLEvent.SendRegister?
|
||||||
|
var hadOneofValue = false
|
||||||
|
if let current = self.event {
|
||||||
|
hadOneofValue = true
|
||||||
|
if case .sendRegister(let m) = current {v = m}
|
||||||
|
}
|
||||||
|
try decoder.decodeSingularMessageField(value: &v)
|
||||||
|
if let v = v {
|
||||||
|
if hadOneofValue {try decoder.handleConflictingOneOf()}
|
||||||
|
self.event = .sendRegister(v)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
case 3: try {
|
||||||
|
var v: SDLEvent.NetworkShutdown?
|
||||||
|
var hadOneofValue = false
|
||||||
|
if let current = self.event {
|
||||||
|
hadOneofValue = true
|
||||||
|
if case .shutdown(let m) = current {v = m}
|
||||||
|
}
|
||||||
|
try decoder.decodeSingularMessageField(value: &v)
|
||||||
|
if let v = v {
|
||||||
|
if hadOneofValue {try decoder.handleConflictingOneOf()}
|
||||||
|
self.event = .shutdown(v)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
default: break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
||||||
|
// The use of inline closures is to circumvent an issue where the compiler
|
||||||
|
// allocates stack space for every if/case branch local when no optimizations
|
||||||
|
// are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
|
||||||
|
// https://github.com/apple/swift-protobuf/issues/1182
|
||||||
|
switch self.event {
|
||||||
|
case .natChanged?: try {
|
||||||
|
guard case .natChanged(let v)? = self.event else { preconditionFailure() }
|
||||||
|
try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
|
||||||
|
}()
|
||||||
|
case .sendRegister?: try {
|
||||||
|
guard case .sendRegister(let v)? = self.event else { preconditionFailure() }
|
||||||
|
try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
|
||||||
|
}()
|
||||||
|
case .shutdown?: try {
|
||||||
|
guard case .shutdown(let v)? = self.event else { preconditionFailure() }
|
||||||
|
try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
|
||||||
|
}()
|
||||||
|
case nil: break
|
||||||
|
}
|
||||||
|
try unknownFields.traverse(visitor: &visitor)
|
||||||
|
}
|
||||||
|
|
||||||
|
static func ==(lhs: SDLEvent, rhs: SDLEvent) -> Bool {
|
||||||
|
if lhs.event != rhs.event {return false}
|
||||||
|
if lhs.unknownFields != rhs.unknownFields {return false}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
extension SDLEvent.NatChanged: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||||
|
static let protoMessageName: String = SDLEvent.protoMessageName + ".NatChanged"
|
||||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||||
1: .same(proto: "mac"),
|
1: .same(proto: "mac"),
|
||||||
2: .same(proto: "ip"),
|
2: .same(proto: "ip"),
|
||||||
@ -1049,7 +1246,7 @@ extension SDLNatChangedEvent: SwiftProtobuf.Message, SwiftProtobuf._MessageImple
|
|||||||
try unknownFields.traverse(visitor: &visitor)
|
try unknownFields.traverse(visitor: &visitor)
|
||||||
}
|
}
|
||||||
|
|
||||||
static func ==(lhs: SDLNatChangedEvent, rhs: SDLNatChangedEvent) -> Bool {
|
static func ==(lhs: SDLEvent.NatChanged, rhs: SDLEvent.NatChanged) -> Bool {
|
||||||
if lhs.mac != rhs.mac {return false}
|
if lhs.mac != rhs.mac {return false}
|
||||||
if lhs.ip != rhs.ip {return false}
|
if lhs.ip != rhs.ip {return false}
|
||||||
if lhs.unknownFields != rhs.unknownFields {return false}
|
if lhs.unknownFields != rhs.unknownFields {return false}
|
||||||
@ -1057,8 +1254,8 @@ extension SDLNatChangedEvent: SwiftProtobuf.Message, SwiftProtobuf._MessageImple
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extension SDLSendRegisterEvent: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
extension SDLEvent.SendRegister: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||||
static let protoMessageName: String = "SDLSendRegisterEvent"
|
static let protoMessageName: String = SDLEvent.protoMessageName + ".SendRegister"
|
||||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||||
1: .standard(proto: "dst_mac"),
|
1: .standard(proto: "dst_mac"),
|
||||||
2: .standard(proto: "nat_ip"),
|
2: .standard(proto: "nat_ip"),
|
||||||
@ -1106,7 +1303,7 @@ extension SDLSendRegisterEvent: SwiftProtobuf.Message, SwiftProtobuf._MessageImp
|
|||||||
try unknownFields.traverse(visitor: &visitor)
|
try unknownFields.traverse(visitor: &visitor)
|
||||||
}
|
}
|
||||||
|
|
||||||
static func ==(lhs: SDLSendRegisterEvent, rhs: SDLSendRegisterEvent) -> Bool {
|
static func ==(lhs: SDLEvent.SendRegister, rhs: SDLEvent.SendRegister) -> Bool {
|
||||||
if lhs.dstMac != rhs.dstMac {return false}
|
if lhs.dstMac != rhs.dstMac {return false}
|
||||||
if lhs.natIp != rhs.natIp {return false}
|
if lhs.natIp != rhs.natIp {return false}
|
||||||
if lhs.natPort != rhs.natPort {return false}
|
if lhs.natPort != rhs.natPort {return false}
|
||||||
@ -1117,8 +1314,8 @@ extension SDLSendRegisterEvent: SwiftProtobuf.Message, SwiftProtobuf._MessageImp
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extension SDLNetworkShutdownEvent: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
extension SDLEvent.NetworkShutdown: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||||
static let protoMessageName: String = "SDLNetworkShutdownEvent"
|
static let protoMessageName: String = SDLEvent.protoMessageName + ".NetworkShutdown"
|
||||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||||
1: .same(proto: "message"),
|
1: .same(proto: "message"),
|
||||||
]
|
]
|
||||||
@ -1142,13 +1339,155 @@ extension SDLNetworkShutdownEvent: SwiftProtobuf.Message, SwiftProtobuf._Message
|
|||||||
try unknownFields.traverse(visitor: &visitor)
|
try unknownFields.traverse(visitor: &visitor)
|
||||||
}
|
}
|
||||||
|
|
||||||
static func ==(lhs: SDLNetworkShutdownEvent, rhs: SDLNetworkShutdownEvent) -> Bool {
|
static func ==(lhs: SDLEvent.NetworkShutdown, rhs: SDLEvent.NetworkShutdown) -> Bool {
|
||||||
if lhs.message != rhs.message {return false}
|
if lhs.message != rhs.message {return false}
|
||||||
if lhs.unknownFields != rhs.unknownFields {return false}
|
if lhs.unknownFields != rhs.unknownFields {return false}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extension SDLCommand: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||||
|
static let protoMessageName: String = "SDLCommand"
|
||||||
|
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||||
|
1: .standard(proto: "pkt_id"),
|
||||||
|
2: .standard(proto: "exit_node"),
|
||||||
|
]
|
||||||
|
|
||||||
|
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
||||||
|
while let fieldNumber = try decoder.nextFieldNumber() {
|
||||||
|
// The use of inline closures is to circumvent an issue where the compiler
|
||||||
|
// allocates stack space for every case branch when no optimizations are
|
||||||
|
// enabled. https://github.com/apple/swift-protobuf/issues/1034
|
||||||
|
switch fieldNumber {
|
||||||
|
case 1: try { try decoder.decodeSingularUInt32Field(value: &self.pktID) }()
|
||||||
|
case 2: try {
|
||||||
|
var v: SDLCommand.ExitNodeControl?
|
||||||
|
var hadOneofValue = false
|
||||||
|
if let current = self.command {
|
||||||
|
hadOneofValue = true
|
||||||
|
if case .exitNode(let m) = current {v = m}
|
||||||
|
}
|
||||||
|
try decoder.decodeSingularMessageField(value: &v)
|
||||||
|
if let v = v {
|
||||||
|
if hadOneofValue {try decoder.handleConflictingOneOf()}
|
||||||
|
self.command = .exitNode(v)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
default: break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
||||||
|
// The use of inline closures is to circumvent an issue where the compiler
|
||||||
|
// allocates stack space for every if/case branch local when no optimizations
|
||||||
|
// are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
|
||||||
|
// https://github.com/apple/swift-protobuf/issues/1182
|
||||||
|
if self.pktID != 0 {
|
||||||
|
try visitor.visitSingularUInt32Field(value: self.pktID, fieldNumber: 1)
|
||||||
|
}
|
||||||
|
try { if case .exitNode(let v)? = self.command {
|
||||||
|
try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
|
||||||
|
} }()
|
||||||
|
try unknownFields.traverse(visitor: &visitor)
|
||||||
|
}
|
||||||
|
|
||||||
|
static func ==(lhs: SDLCommand, rhs: SDLCommand) -> Bool {
|
||||||
|
if lhs.pktID != rhs.pktID {return false}
|
||||||
|
if lhs.command != rhs.command {return false}
|
||||||
|
if lhs.unknownFields != rhs.unknownFields {return false}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
extension SDLCommand.ExitNodeControl: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||||
|
static let protoMessageName: String = SDLCommand.protoMessageName + ".ExitNodeControl"
|
||||||
|
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||||
|
1: .same(proto: "action"),
|
||||||
|
2: .same(proto: "remark"),
|
||||||
|
]
|
||||||
|
|
||||||
|
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
||||||
|
while let fieldNumber = try decoder.nextFieldNumber() {
|
||||||
|
// The use of inline closures is to circumvent an issue where the compiler
|
||||||
|
// allocates stack space for every case branch when no optimizations are
|
||||||
|
// enabled. https://github.com/apple/swift-protobuf/issues/1034
|
||||||
|
switch fieldNumber {
|
||||||
|
case 1: try { try decoder.decodeSingularInt32Field(value: &self.action) }()
|
||||||
|
case 2: try { try decoder.decodeSingularStringField(value: &self.remark) }()
|
||||||
|
default: break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
||||||
|
if self.action != 0 {
|
||||||
|
try visitor.visitSingularInt32Field(value: self.action, fieldNumber: 1)
|
||||||
|
}
|
||||||
|
if !self.remark.isEmpty {
|
||||||
|
try visitor.visitSingularStringField(value: self.remark, fieldNumber: 2)
|
||||||
|
}
|
||||||
|
try unknownFields.traverse(visitor: &visitor)
|
||||||
|
}
|
||||||
|
|
||||||
|
static func ==(lhs: SDLCommand.ExitNodeControl, rhs: SDLCommand.ExitNodeControl) -> Bool {
|
||||||
|
if lhs.action != rhs.action {return false}
|
||||||
|
if lhs.remark != rhs.remark {return false}
|
||||||
|
if lhs.unknownFields != rhs.unknownFields {return false}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
extension SDLCommandAck: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||||
|
static let protoMessageName: String = "SDLCommandAck"
|
||||||
|
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||||
|
1: .standard(proto: "pkt_id"),
|
||||||
|
2: .same(proto: "code"),
|
||||||
|
3: .same(proto: "message"),
|
||||||
|
4: .same(proto: "data"),
|
||||||
|
]
|
||||||
|
|
||||||
|
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
||||||
|
while let fieldNumber = try decoder.nextFieldNumber() {
|
||||||
|
// The use of inline closures is to circumvent an issue where the compiler
|
||||||
|
// allocates stack space for every case branch when no optimizations are
|
||||||
|
// enabled. https://github.com/apple/swift-protobuf/issues/1034
|
||||||
|
switch fieldNumber {
|
||||||
|
case 1: try { try decoder.decodeSingularUInt32Field(value: &self.pktID) }()
|
||||||
|
case 2: try { try decoder.decodeSingularInt32Field(value: &self.code) }()
|
||||||
|
case 3: try { try decoder.decodeSingularStringField(value: &self.message) }()
|
||||||
|
case 4: try { try decoder.decodeSingularBytesField(value: &self.data) }()
|
||||||
|
default: break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
||||||
|
if self.pktID != 0 {
|
||||||
|
try visitor.visitSingularUInt32Field(value: self.pktID, fieldNumber: 1)
|
||||||
|
}
|
||||||
|
if self.code != 0 {
|
||||||
|
try visitor.visitSingularInt32Field(value: self.code, fieldNumber: 2)
|
||||||
|
}
|
||||||
|
if !self.message.isEmpty {
|
||||||
|
try visitor.visitSingularStringField(value: self.message, fieldNumber: 3)
|
||||||
|
}
|
||||||
|
if !self.data.isEmpty {
|
||||||
|
try visitor.visitSingularBytesField(value: self.data, fieldNumber: 4)
|
||||||
|
}
|
||||||
|
try unknownFields.traverse(visitor: &visitor)
|
||||||
|
}
|
||||||
|
|
||||||
|
static func ==(lhs: SDLCommandAck, rhs: SDLCommandAck) -> Bool {
|
||||||
|
if lhs.pktID != rhs.pktID {return false}
|
||||||
|
if lhs.code != rhs.code {return false}
|
||||||
|
if lhs.message != rhs.message {return false}
|
||||||
|
if lhs.data != rhs.data {return false}
|
||||||
|
if lhs.unknownFields != rhs.unknownFields {return false}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
extension SDLStunRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
extension SDLStunRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||||
static let protoMessageName: String = "SDLStunRequest"
|
static let protoMessageName: String = "SDLStunRequest"
|
||||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||||
|
|||||||
@ -137,9 +137,3 @@ enum SDLEventType: UInt8 {
|
|||||||
case sendRegister = 0x04
|
case sendRegister = 0x04
|
||||||
case networkShutdown = 0xFF
|
case networkShutdown = 0xFF
|
||||||
}
|
}
|
||||||
|
|
||||||
enum SDLEvent {
|
|
||||||
case natChanged(SDLNatChangedEvent)
|
|
||||||
case sendRegister(SDLSendRegisterEvent)
|
|
||||||
case networkShutdown(SDLNetworkShutdownEvent)
|
|
||||||
}
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user