1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359 |
- // Code generated by protoc-gen-gogo. DO NOT EDIT.
- // source: nebula.proto
- package nebula
- import (
- fmt "fmt"
- proto "github.com/gogo/protobuf/proto"
- io "io"
- math "math"
- math_bits "math/bits"
- )
- // Reference imports to suppress errors if they are not otherwise used.
- var _ = proto.Marshal
- var _ = fmt.Errorf
- var _ = math.Inf
- // This is a compile-time assertion to ensure that this generated file
- // is compatible with the proto package it is being compiled against.
- // A compilation error at this line likely means your copy of the
- // proto package needs to be updated.
- const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
- type NebulaMeta_MessageType int32
- const (
- NebulaMeta_None NebulaMeta_MessageType = 0
- NebulaMeta_HostQuery NebulaMeta_MessageType = 1
- NebulaMeta_HostQueryReply NebulaMeta_MessageType = 2
- NebulaMeta_HostUpdateNotification NebulaMeta_MessageType = 3
- NebulaMeta_HostMovedNotification NebulaMeta_MessageType = 4
- NebulaMeta_HostPunchNotification NebulaMeta_MessageType = 5
- NebulaMeta_HostWhoami NebulaMeta_MessageType = 6
- NebulaMeta_HostWhoamiReply NebulaMeta_MessageType = 7
- NebulaMeta_PathCheck NebulaMeta_MessageType = 8
- NebulaMeta_PathCheckReply NebulaMeta_MessageType = 9
- )
- var NebulaMeta_MessageType_name = map[int32]string{
- 0: "None",
- 1: "HostQuery",
- 2: "HostQueryReply",
- 3: "HostUpdateNotification",
- 4: "HostMovedNotification",
- 5: "HostPunchNotification",
- 6: "HostWhoami",
- 7: "HostWhoamiReply",
- 8: "PathCheck",
- 9: "PathCheckReply",
- }
- var NebulaMeta_MessageType_value = map[string]int32{
- "None": 0,
- "HostQuery": 1,
- "HostQueryReply": 2,
- "HostUpdateNotification": 3,
- "HostMovedNotification": 4,
- "HostPunchNotification": 5,
- "HostWhoami": 6,
- "HostWhoamiReply": 7,
- "PathCheck": 8,
- "PathCheckReply": 9,
- }
- func (x NebulaMeta_MessageType) String() string {
- return proto.EnumName(NebulaMeta_MessageType_name, int32(x))
- }
- func (NebulaMeta_MessageType) EnumDescriptor() ([]byte, []int) {
- return fileDescriptor_2d65afa7693df5ef, []int{0, 0}
- }
- type NebulaPing_MessageType int32
- const (
- NebulaPing_Ping NebulaPing_MessageType = 0
- NebulaPing_Reply NebulaPing_MessageType = 1
- )
- var NebulaPing_MessageType_name = map[int32]string{
- 0: "Ping",
- 1: "Reply",
- }
- var NebulaPing_MessageType_value = map[string]int32{
- "Ping": 0,
- "Reply": 1,
- }
- func (x NebulaPing_MessageType) String() string {
- return proto.EnumName(NebulaPing_MessageType_name, int32(x))
- }
- func (NebulaPing_MessageType) EnumDescriptor() ([]byte, []int) {
- return fileDescriptor_2d65afa7693df5ef, []int{4, 0}
- }
- type NebulaControl_MessageType int32
- const (
- NebulaControl_None NebulaControl_MessageType = 0
- NebulaControl_CreateRelayRequest NebulaControl_MessageType = 1
- NebulaControl_CreateRelayResponse NebulaControl_MessageType = 2
- )
- var NebulaControl_MessageType_name = map[int32]string{
- 0: "None",
- 1: "CreateRelayRequest",
- 2: "CreateRelayResponse",
- }
- var NebulaControl_MessageType_value = map[string]int32{
- "None": 0,
- "CreateRelayRequest": 1,
- "CreateRelayResponse": 2,
- }
- func (x NebulaControl_MessageType) String() string {
- return proto.EnumName(NebulaControl_MessageType_name, int32(x))
- }
- func (NebulaControl_MessageType) EnumDescriptor() ([]byte, []int) {
- return fileDescriptor_2d65afa7693df5ef, []int{7, 0}
- }
- type NebulaMeta struct {
- Type NebulaMeta_MessageType `protobuf:"varint,1,opt,name=Type,proto3,enum=nebula.NebulaMeta_MessageType" json:"Type,omitempty"`
- Details *NebulaMetaDetails `protobuf:"bytes,2,opt,name=Details,proto3" json:"Details,omitempty"`
- }
- func (m *NebulaMeta) Reset() { *m = NebulaMeta{} }
- func (m *NebulaMeta) String() string { return proto.CompactTextString(m) }
- func (*NebulaMeta) ProtoMessage() {}
- func (*NebulaMeta) Descriptor() ([]byte, []int) {
- return fileDescriptor_2d65afa7693df5ef, []int{0}
- }
- func (m *NebulaMeta) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
- }
- func (m *NebulaMeta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_NebulaMeta.Marshal(b, m, deterministic)
- } else {
- b = b[:cap(b)]
- n, err := m.MarshalToSizedBuffer(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
- }
- }
- func (m *NebulaMeta) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NebulaMeta.Merge(m, src)
- }
- func (m *NebulaMeta) XXX_Size() int {
- return m.Size()
- }
- func (m *NebulaMeta) XXX_DiscardUnknown() {
- xxx_messageInfo_NebulaMeta.DiscardUnknown(m)
- }
- var xxx_messageInfo_NebulaMeta proto.InternalMessageInfo
- func (m *NebulaMeta) GetType() NebulaMeta_MessageType {
- if m != nil {
- return m.Type
- }
- return NebulaMeta_None
- }
- func (m *NebulaMeta) GetDetails() *NebulaMetaDetails {
- if m != nil {
- return m.Details
- }
- return nil
- }
- type NebulaMetaDetails struct {
- VpnIp uint32 `protobuf:"varint,1,opt,name=VpnIp,proto3" json:"VpnIp,omitempty"`
- Ip4AndPorts []*Ip4AndPort `protobuf:"bytes,2,rep,name=Ip4AndPorts,proto3" json:"Ip4AndPorts,omitempty"`
- Ip6AndPorts []*Ip6AndPort `protobuf:"bytes,4,rep,name=Ip6AndPorts,proto3" json:"Ip6AndPorts,omitempty"`
- RelayVpnIp []uint32 `protobuf:"varint,5,rep,packed,name=RelayVpnIp,proto3" json:"RelayVpnIp,omitempty"`
- Counter uint32 `protobuf:"varint,3,opt,name=counter,proto3" json:"counter,omitempty"`
- }
- func (m *NebulaMetaDetails) Reset() { *m = NebulaMetaDetails{} }
- func (m *NebulaMetaDetails) String() string { return proto.CompactTextString(m) }
- func (*NebulaMetaDetails) ProtoMessage() {}
- func (*NebulaMetaDetails) Descriptor() ([]byte, []int) {
- return fileDescriptor_2d65afa7693df5ef, []int{1}
- }
- func (m *NebulaMetaDetails) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
- }
- func (m *NebulaMetaDetails) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_NebulaMetaDetails.Marshal(b, m, deterministic)
- } else {
- b = b[:cap(b)]
- n, err := m.MarshalToSizedBuffer(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
- }
- }
- func (m *NebulaMetaDetails) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NebulaMetaDetails.Merge(m, src)
- }
- func (m *NebulaMetaDetails) XXX_Size() int {
- return m.Size()
- }
- func (m *NebulaMetaDetails) XXX_DiscardUnknown() {
- xxx_messageInfo_NebulaMetaDetails.DiscardUnknown(m)
- }
- var xxx_messageInfo_NebulaMetaDetails proto.InternalMessageInfo
- func (m *NebulaMetaDetails) GetVpnIp() uint32 {
- if m != nil {
- return m.VpnIp
- }
- return 0
- }
- func (m *NebulaMetaDetails) GetIp4AndPorts() []*Ip4AndPort {
- if m != nil {
- return m.Ip4AndPorts
- }
- return nil
- }
- func (m *NebulaMetaDetails) GetIp6AndPorts() []*Ip6AndPort {
- if m != nil {
- return m.Ip6AndPorts
- }
- return nil
- }
- func (m *NebulaMetaDetails) GetRelayVpnIp() []uint32 {
- if m != nil {
- return m.RelayVpnIp
- }
- return nil
- }
- func (m *NebulaMetaDetails) GetCounter() uint32 {
- if m != nil {
- return m.Counter
- }
- return 0
- }
- type Ip4AndPort struct {
- Ip uint32 `protobuf:"varint,1,opt,name=Ip,proto3" json:"Ip,omitempty"`
- Port uint32 `protobuf:"varint,2,opt,name=Port,proto3" json:"Port,omitempty"`
- }
- func (m *Ip4AndPort) Reset() { *m = Ip4AndPort{} }
- func (m *Ip4AndPort) String() string { return proto.CompactTextString(m) }
- func (*Ip4AndPort) ProtoMessage() {}
- func (*Ip4AndPort) Descriptor() ([]byte, []int) {
- return fileDescriptor_2d65afa7693df5ef, []int{2}
- }
- func (m *Ip4AndPort) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
- }
- func (m *Ip4AndPort) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_Ip4AndPort.Marshal(b, m, deterministic)
- } else {
- b = b[:cap(b)]
- n, err := m.MarshalToSizedBuffer(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
- }
- }
- func (m *Ip4AndPort) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Ip4AndPort.Merge(m, src)
- }
- func (m *Ip4AndPort) XXX_Size() int {
- return m.Size()
- }
- func (m *Ip4AndPort) XXX_DiscardUnknown() {
- xxx_messageInfo_Ip4AndPort.DiscardUnknown(m)
- }
- var xxx_messageInfo_Ip4AndPort proto.InternalMessageInfo
- func (m *Ip4AndPort) GetIp() uint32 {
- if m != nil {
- return m.Ip
- }
- return 0
- }
- func (m *Ip4AndPort) GetPort() uint32 {
- if m != nil {
- return m.Port
- }
- return 0
- }
- type Ip6AndPort struct {
- Hi uint64 `protobuf:"varint,1,opt,name=Hi,proto3" json:"Hi,omitempty"`
- Lo uint64 `protobuf:"varint,2,opt,name=Lo,proto3" json:"Lo,omitempty"`
- Port uint32 `protobuf:"varint,3,opt,name=Port,proto3" json:"Port,omitempty"`
- }
- func (m *Ip6AndPort) Reset() { *m = Ip6AndPort{} }
- func (m *Ip6AndPort) String() string { return proto.CompactTextString(m) }
- func (*Ip6AndPort) ProtoMessage() {}
- func (*Ip6AndPort) Descriptor() ([]byte, []int) {
- return fileDescriptor_2d65afa7693df5ef, []int{3}
- }
- func (m *Ip6AndPort) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
- }
- func (m *Ip6AndPort) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_Ip6AndPort.Marshal(b, m, deterministic)
- } else {
- b = b[:cap(b)]
- n, err := m.MarshalToSizedBuffer(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
- }
- }
- func (m *Ip6AndPort) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Ip6AndPort.Merge(m, src)
- }
- func (m *Ip6AndPort) XXX_Size() int {
- return m.Size()
- }
- func (m *Ip6AndPort) XXX_DiscardUnknown() {
- xxx_messageInfo_Ip6AndPort.DiscardUnknown(m)
- }
- var xxx_messageInfo_Ip6AndPort proto.InternalMessageInfo
- func (m *Ip6AndPort) GetHi() uint64 {
- if m != nil {
- return m.Hi
- }
- return 0
- }
- func (m *Ip6AndPort) GetLo() uint64 {
- if m != nil {
- return m.Lo
- }
- return 0
- }
- func (m *Ip6AndPort) GetPort() uint32 {
- if m != nil {
- return m.Port
- }
- return 0
- }
- type NebulaPing struct {
- Type NebulaPing_MessageType `protobuf:"varint,1,opt,name=Type,proto3,enum=nebula.NebulaPing_MessageType" json:"Type,omitempty"`
- Time uint64 `protobuf:"varint,2,opt,name=Time,proto3" json:"Time,omitempty"`
- }
- func (m *NebulaPing) Reset() { *m = NebulaPing{} }
- func (m *NebulaPing) String() string { return proto.CompactTextString(m) }
- func (*NebulaPing) ProtoMessage() {}
- func (*NebulaPing) Descriptor() ([]byte, []int) {
- return fileDescriptor_2d65afa7693df5ef, []int{4}
- }
- func (m *NebulaPing) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
- }
- func (m *NebulaPing) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_NebulaPing.Marshal(b, m, deterministic)
- } else {
- b = b[:cap(b)]
- n, err := m.MarshalToSizedBuffer(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
- }
- }
- func (m *NebulaPing) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NebulaPing.Merge(m, src)
- }
- func (m *NebulaPing) XXX_Size() int {
- return m.Size()
- }
- func (m *NebulaPing) XXX_DiscardUnknown() {
- xxx_messageInfo_NebulaPing.DiscardUnknown(m)
- }
- var xxx_messageInfo_NebulaPing proto.InternalMessageInfo
- func (m *NebulaPing) GetType() NebulaPing_MessageType {
- if m != nil {
- return m.Type
- }
- return NebulaPing_Ping
- }
- func (m *NebulaPing) GetTime() uint64 {
- if m != nil {
- return m.Time
- }
- return 0
- }
- type NebulaHandshake struct {
- Details *NebulaHandshakeDetails `protobuf:"bytes,1,opt,name=Details,proto3" json:"Details,omitempty"`
- Hmac []byte `protobuf:"bytes,2,opt,name=Hmac,proto3" json:"Hmac,omitempty"`
- }
- func (m *NebulaHandshake) Reset() { *m = NebulaHandshake{} }
- func (m *NebulaHandshake) String() string { return proto.CompactTextString(m) }
- func (*NebulaHandshake) ProtoMessage() {}
- func (*NebulaHandshake) Descriptor() ([]byte, []int) {
- return fileDescriptor_2d65afa7693df5ef, []int{5}
- }
- func (m *NebulaHandshake) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
- }
- func (m *NebulaHandshake) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_NebulaHandshake.Marshal(b, m, deterministic)
- } else {
- b = b[:cap(b)]
- n, err := m.MarshalToSizedBuffer(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
- }
- }
- func (m *NebulaHandshake) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NebulaHandshake.Merge(m, src)
- }
- func (m *NebulaHandshake) XXX_Size() int {
- return m.Size()
- }
- func (m *NebulaHandshake) XXX_DiscardUnknown() {
- xxx_messageInfo_NebulaHandshake.DiscardUnknown(m)
- }
- var xxx_messageInfo_NebulaHandshake proto.InternalMessageInfo
- func (m *NebulaHandshake) GetDetails() *NebulaHandshakeDetails {
- if m != nil {
- return m.Details
- }
- return nil
- }
- func (m *NebulaHandshake) GetHmac() []byte {
- if m != nil {
- return m.Hmac
- }
- return nil
- }
- type NebulaHandshakeDetails struct {
- Cert []byte `protobuf:"bytes,1,opt,name=Cert,proto3" json:"Cert,omitempty"`
- InitiatorIndex uint32 `protobuf:"varint,2,opt,name=InitiatorIndex,proto3" json:"InitiatorIndex,omitempty"`
- ResponderIndex uint32 `protobuf:"varint,3,opt,name=ResponderIndex,proto3" json:"ResponderIndex,omitempty"`
- Cookie uint64 `protobuf:"varint,4,opt,name=Cookie,proto3" json:"Cookie,omitempty"`
- Time uint64 `protobuf:"varint,5,opt,name=Time,proto3" json:"Time,omitempty"`
- }
- func (m *NebulaHandshakeDetails) Reset() { *m = NebulaHandshakeDetails{} }
- func (m *NebulaHandshakeDetails) String() string { return proto.CompactTextString(m) }
- func (*NebulaHandshakeDetails) ProtoMessage() {}
- func (*NebulaHandshakeDetails) Descriptor() ([]byte, []int) {
- return fileDescriptor_2d65afa7693df5ef, []int{6}
- }
- func (m *NebulaHandshakeDetails) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
- }
- func (m *NebulaHandshakeDetails) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_NebulaHandshakeDetails.Marshal(b, m, deterministic)
- } else {
- b = b[:cap(b)]
- n, err := m.MarshalToSizedBuffer(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
- }
- }
- func (m *NebulaHandshakeDetails) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NebulaHandshakeDetails.Merge(m, src)
- }
- func (m *NebulaHandshakeDetails) XXX_Size() int {
- return m.Size()
- }
- func (m *NebulaHandshakeDetails) XXX_DiscardUnknown() {
- xxx_messageInfo_NebulaHandshakeDetails.DiscardUnknown(m)
- }
- var xxx_messageInfo_NebulaHandshakeDetails proto.InternalMessageInfo
- func (m *NebulaHandshakeDetails) GetCert() []byte {
- if m != nil {
- return m.Cert
- }
- return nil
- }
- func (m *NebulaHandshakeDetails) GetInitiatorIndex() uint32 {
- if m != nil {
- return m.InitiatorIndex
- }
- return 0
- }
- func (m *NebulaHandshakeDetails) GetResponderIndex() uint32 {
- if m != nil {
- return m.ResponderIndex
- }
- return 0
- }
- func (m *NebulaHandshakeDetails) GetCookie() uint64 {
- if m != nil {
- return m.Cookie
- }
- return 0
- }
- func (m *NebulaHandshakeDetails) GetTime() uint64 {
- if m != nil {
- return m.Time
- }
- return 0
- }
- type NebulaControl struct {
- Type NebulaControl_MessageType `protobuf:"varint,1,opt,name=Type,proto3,enum=nebula.NebulaControl_MessageType" json:"Type,omitempty"`
- InitiatorRelayIndex uint32 `protobuf:"varint,2,opt,name=InitiatorRelayIndex,proto3" json:"InitiatorRelayIndex,omitempty"`
- ResponderRelayIndex uint32 `protobuf:"varint,3,opt,name=ResponderRelayIndex,proto3" json:"ResponderRelayIndex,omitempty"`
- RelayToIp uint32 `protobuf:"varint,4,opt,name=RelayToIp,proto3" json:"RelayToIp,omitempty"`
- RelayFromIp uint32 `protobuf:"varint,5,opt,name=RelayFromIp,proto3" json:"RelayFromIp,omitempty"`
- }
- func (m *NebulaControl) Reset() { *m = NebulaControl{} }
- func (m *NebulaControl) String() string { return proto.CompactTextString(m) }
- func (*NebulaControl) ProtoMessage() {}
- func (*NebulaControl) Descriptor() ([]byte, []int) {
- return fileDescriptor_2d65afa7693df5ef, []int{7}
- }
- func (m *NebulaControl) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
- }
- func (m *NebulaControl) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_NebulaControl.Marshal(b, m, deterministic)
- } else {
- b = b[:cap(b)]
- n, err := m.MarshalToSizedBuffer(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
- }
- }
- func (m *NebulaControl) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NebulaControl.Merge(m, src)
- }
- func (m *NebulaControl) XXX_Size() int {
- return m.Size()
- }
- func (m *NebulaControl) XXX_DiscardUnknown() {
- xxx_messageInfo_NebulaControl.DiscardUnknown(m)
- }
- var xxx_messageInfo_NebulaControl proto.InternalMessageInfo
- func (m *NebulaControl) GetType() NebulaControl_MessageType {
- if m != nil {
- return m.Type
- }
- return NebulaControl_None
- }
- func (m *NebulaControl) GetInitiatorRelayIndex() uint32 {
- if m != nil {
- return m.InitiatorRelayIndex
- }
- return 0
- }
- func (m *NebulaControl) GetResponderRelayIndex() uint32 {
- if m != nil {
- return m.ResponderRelayIndex
- }
- return 0
- }
- func (m *NebulaControl) GetRelayToIp() uint32 {
- if m != nil {
- return m.RelayToIp
- }
- return 0
- }
- func (m *NebulaControl) GetRelayFromIp() uint32 {
- if m != nil {
- return m.RelayFromIp
- }
- return 0
- }
- func init() {
- proto.RegisterEnum("nebula.NebulaMeta_MessageType", NebulaMeta_MessageType_name, NebulaMeta_MessageType_value)
- proto.RegisterEnum("nebula.NebulaPing_MessageType", NebulaPing_MessageType_name, NebulaPing_MessageType_value)
- proto.RegisterEnum("nebula.NebulaControl_MessageType", NebulaControl_MessageType_name, NebulaControl_MessageType_value)
- proto.RegisterType((*NebulaMeta)(nil), "nebula.NebulaMeta")
- proto.RegisterType((*NebulaMetaDetails)(nil), "nebula.NebulaMetaDetails")
- proto.RegisterType((*Ip4AndPort)(nil), "nebula.Ip4AndPort")
- proto.RegisterType((*Ip6AndPort)(nil), "nebula.Ip6AndPort")
- proto.RegisterType((*NebulaPing)(nil), "nebula.NebulaPing")
- proto.RegisterType((*NebulaHandshake)(nil), "nebula.NebulaHandshake")
- proto.RegisterType((*NebulaHandshakeDetails)(nil), "nebula.NebulaHandshakeDetails")
- proto.RegisterType((*NebulaControl)(nil), "nebula.NebulaControl")
- }
- func init() { proto.RegisterFile("nebula.proto", fileDescriptor_2d65afa7693df5ef) }
- var fileDescriptor_2d65afa7693df5ef = []byte{
- // 696 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x54, 0xcd, 0x6e, 0xd3, 0x4a,
- 0x14, 0x8e, 0x1d, 0xe7, 0xef, 0xa4, 0x49, 0x7d, 0x4f, 0xef, 0xcd, 0x4d, 0xaf, 0xae, 0xac, 0xe0,
- 0x05, 0xca, 0x2a, 0xad, 0xd2, 0x52, 0xb1, 0x04, 0x82, 0x50, 0x52, 0xb5, 0x55, 0x18, 0x15, 0x90,
- 0xd8, 0xa0, 0x69, 0x32, 0xd4, 0x56, 0x12, 0x8f, 0x6b, 0x4f, 0x50, 0xf3, 0x16, 0x3c, 0x4c, 0x1f,
- 0x82, 0x05, 0x12, 0x5d, 0xb0, 0x60, 0x89, 0xda, 0x17, 0x41, 0x33, 0x76, 0x6c, 0x27, 0x0d, 0xec,
- 0xce, 0xcf, 0xf7, 0xcd, 0x7c, 0xe7, 0x9b, 0x63, 0xc3, 0x96, 0xc7, 0x2e, 0xe6, 0x53, 0xda, 0xf1,
- 0x03, 0x2e, 0x38, 0x16, 0xa3, 0xcc, 0xfe, 0xaa, 0x03, 0x9c, 0xa9, 0xf0, 0x94, 0x09, 0x8a, 0x5d,
- 0x30, 0xce, 0x17, 0x3e, 0x6b, 0x6a, 0x2d, 0xad, 0x5d, 0xef, 0x5a, 0x9d, 0x98, 0x93, 0x22, 0x3a,
- 0xa7, 0x2c, 0x0c, 0xe9, 0x25, 0x93, 0x28, 0xa2, 0xb0, 0x78, 0x00, 0xa5, 0x97, 0x4c, 0x50, 0x77,
- 0x1a, 0x36, 0xf5, 0x96, 0xd6, 0xae, 0x76, 0x77, 0x1f, 0xd2, 0x62, 0x00, 0x59, 0x22, 0xed, 0xef,
- 0x1a, 0x54, 0x33, 0x47, 0x61, 0x19, 0x8c, 0x33, 0xee, 0x31, 0x33, 0x87, 0x35, 0xa8, 0xf4, 0x79,
- 0x28, 0x5e, 0xcf, 0x59, 0xb0, 0x30, 0x35, 0x44, 0xa8, 0x27, 0x29, 0x61, 0xfe, 0x74, 0x61, 0xea,
- 0xf8, 0x1f, 0x34, 0x64, 0xed, 0x8d, 0x3f, 0xa6, 0x82, 0x9d, 0x71, 0xe1, 0x7e, 0x74, 0x47, 0x54,
- 0xb8, 0xdc, 0x33, 0xf3, 0xb8, 0x0b, 0xff, 0xc8, 0xde, 0x29, 0xff, 0xc4, 0xc6, 0x2b, 0x2d, 0x63,
- 0xd9, 0x1a, 0xce, 0xbd, 0x91, 0xb3, 0xd2, 0x2a, 0x60, 0x1d, 0x40, 0xb6, 0xde, 0x39, 0x9c, 0xce,
- 0x5c, 0xb3, 0x88, 0x3b, 0xb0, 0x9d, 0xe6, 0xd1, 0xb5, 0x25, 0xa9, 0x6c, 0x48, 0x85, 0xd3, 0x73,
- 0xd8, 0x68, 0x62, 0x96, 0xa5, 0xb2, 0x24, 0x8d, 0x20, 0x15, 0xfb, 0x9b, 0x06, 0x7f, 0x3d, 0x98,
- 0x1a, 0xff, 0x86, 0xc2, 0x5b, 0xdf, 0x1b, 0xf8, 0xca, 0xd6, 0x1a, 0x89, 0x12, 0x3c, 0x84, 0xea,
- 0xc0, 0x3f, 0x7c, 0xee, 0x8d, 0x87, 0x3c, 0x10, 0xd2, 0xbb, 0x7c, 0xbb, 0xda, 0xc5, 0xa5, 0x77,
- 0x69, 0x8b, 0x64, 0x61, 0x11, 0xeb, 0x28, 0x61, 0x19, 0xeb, 0xac, 0xa3, 0x0c, 0x2b, 0x81, 0xa1,
- 0x05, 0x40, 0xd8, 0x94, 0x2e, 0x22, 0x19, 0x85, 0x56, 0xbe, 0x5d, 0x23, 0x99, 0x0a, 0x36, 0xa1,
- 0x34, 0xe2, 0x73, 0x4f, 0xb0, 0xa0, 0x99, 0x57, 0x1a, 0x97, 0xa9, 0xbd, 0x0f, 0x90, 0x5e, 0x8f,
- 0x75, 0xd0, 0x93, 0x31, 0xf4, 0x81, 0x8f, 0x08, 0x86, 0xac, 0xab, 0x87, 0xaf, 0x11, 0x15, 0xdb,
- 0xcf, 0x24, 0xe3, 0x28, 0xc3, 0xe8, 0xbb, 0x8a, 0x61, 0x10, 0xbd, 0xef, 0xca, 0xfc, 0x84, 0x2b,
- 0xbc, 0x41, 0xf4, 0x13, 0x9e, 0x9c, 0x90, 0xcf, 0x9c, 0x70, 0xbd, 0xdc, 0xc9, 0xa1, 0xeb, 0x5d,
- 0xfe, 0x79, 0x27, 0x25, 0x62, 0xc3, 0x4e, 0x22, 0x18, 0xe7, 0xee, 0x8c, 0xc5, 0xf7, 0xa8, 0xd8,
- 0xb6, 0x1f, 0x6c, 0x9c, 0x24, 0x9b, 0x39, 0xac, 0x40, 0x21, 0x7a, 0x3f, 0xcd, 0xfe, 0x00, 0xdb,
- 0xd1, 0xb9, 0x7d, 0xea, 0x8d, 0x43, 0x87, 0x4e, 0x18, 0x3e, 0x4d, 0xd7, 0x5b, 0x53, 0xeb, 0xbd,
- 0xa6, 0x20, 0x41, 0xae, 0xef, 0xb8, 0x14, 0xd1, 0x9f, 0xd1, 0x91, 0x12, 0xb1, 0x45, 0x54, 0x6c,
- 0xdf, 0x68, 0xd0, 0xd8, 0xcc, 0x93, 0xf0, 0x1e, 0x0b, 0x84, 0xba, 0x65, 0x8b, 0xa8, 0x18, 0x1f,
- 0x43, 0x7d, 0xe0, 0xb9, 0xc2, 0xa5, 0x82, 0x07, 0x03, 0x6f, 0xcc, 0xae, 0x63, 0xa7, 0xd7, 0xaa,
- 0x12, 0x47, 0x58, 0xe8, 0x73, 0x6f, 0xcc, 0x62, 0x5c, 0xe4, 0xe7, 0x5a, 0x15, 0x1b, 0x50, 0xec,
- 0x71, 0x3e, 0x71, 0x59, 0xd3, 0x50, 0xce, 0xc4, 0x59, 0xe2, 0x57, 0x21, 0xf5, 0xeb, 0xd8, 0x28,
- 0x17, 0xcd, 0xd2, 0xb1, 0x51, 0x2e, 0x99, 0x65, 0xfb, 0x46, 0x87, 0x5a, 0x24, 0xbb, 0xc7, 0x3d,
- 0x11, 0xf0, 0x29, 0x3e, 0x59, 0x79, 0x95, 0x47, 0xab, 0x9e, 0xc4, 0xa0, 0x0d, 0x0f, 0xb3, 0x0f,
- 0x3b, 0x89, 0x74, 0xb5, 0x7f, 0xd9, 0xa9, 0x36, 0xb5, 0x24, 0x23, 0x19, 0x22, 0xc3, 0x88, 0xe6,
- 0xdb, 0xd4, 0xc2, 0xff, 0xa1, 0xa2, 0xb2, 0x73, 0x3e, 0xf0, 0xd5, 0x9c, 0x35, 0x92, 0x16, 0xb0,
- 0x05, 0x55, 0x95, 0xbc, 0x0a, 0xf8, 0x4c, 0x7d, 0x0b, 0xb2, 0x9f, 0x2d, 0xd9, 0xfd, 0xdf, 0xfd,
- 0x9a, 0x1a, 0x80, 0xbd, 0x80, 0x51, 0xc1, 0x14, 0x9a, 0xb0, 0xab, 0x39, 0x0b, 0x85, 0xa9, 0xe1,
- 0xbf, 0xb0, 0xb3, 0x52, 0x97, 0x92, 0x42, 0x66, 0xea, 0x2f, 0x0e, 0xbe, 0xdc, 0x59, 0xda, 0xed,
- 0x9d, 0xa5, 0xfd, 0xbc, 0xb3, 0xb4, 0xcf, 0xf7, 0x56, 0xee, 0xf6, 0xde, 0xca, 0xfd, 0xb8, 0xb7,
- 0x72, 0xef, 0x77, 0x2f, 0x5d, 0xe1, 0xcc, 0x2f, 0x3a, 0x23, 0x3e, 0xdb, 0x0b, 0xa7, 0x74, 0x34,
- 0x71, 0xae, 0xf6, 0x22, 0x0b, 0x2f, 0x8a, 0xea, 0x0f, 0x7d, 0xf0, 0x2b, 0x00, 0x00, 0xff, 0xff,
- 0xcd, 0xd7, 0xbe, 0xd5, 0xb1, 0x05, 0x00, 0x00,
- }
- func (m *NebulaMeta) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalToSizedBuffer(dAtA[:size])
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
- }
- func (m *NebulaMeta) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
- }
- func (m *NebulaMeta) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.Details != nil {
- {
- size, err := m.Details.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintNebula(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x12
- }
- if m.Type != 0 {
- i = encodeVarintNebula(dAtA, i, uint64(m.Type))
- i--
- dAtA[i] = 0x8
- }
- return len(dAtA) - i, nil
- }
- func (m *NebulaMetaDetails) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalToSizedBuffer(dAtA[:size])
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
- }
- func (m *NebulaMetaDetails) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
- }
- func (m *NebulaMetaDetails) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if len(m.RelayVpnIp) > 0 {
- dAtA3 := make([]byte, len(m.RelayVpnIp)*10)
- var j2 int
- for _, num := range m.RelayVpnIp {
- for num >= 1<<7 {
- dAtA3[j2] = uint8(uint64(num)&0x7f | 0x80)
- num >>= 7
- j2++
- }
- dAtA3[j2] = uint8(num)
- j2++
- }
- i -= j2
- copy(dAtA[i:], dAtA3[:j2])
- i = encodeVarintNebula(dAtA, i, uint64(j2))
- i--
- dAtA[i] = 0x2a
- }
- if len(m.Ip6AndPorts) > 0 {
- for iNdEx := len(m.Ip6AndPorts) - 1; iNdEx >= 0; iNdEx-- {
- {
- size, err := m.Ip6AndPorts[iNdEx].MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintNebula(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x22
- }
- }
- if m.Counter != 0 {
- i = encodeVarintNebula(dAtA, i, uint64(m.Counter))
- i--
- dAtA[i] = 0x18
- }
- if len(m.Ip4AndPorts) > 0 {
- for iNdEx := len(m.Ip4AndPorts) - 1; iNdEx >= 0; iNdEx-- {
- {
- size, err := m.Ip4AndPorts[iNdEx].MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintNebula(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x12
- }
- }
- if m.VpnIp != 0 {
- i = encodeVarintNebula(dAtA, i, uint64(m.VpnIp))
- i--
- dAtA[i] = 0x8
- }
- return len(dAtA) - i, nil
- }
- func (m *Ip4AndPort) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalToSizedBuffer(dAtA[:size])
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
- }
- func (m *Ip4AndPort) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
- }
- func (m *Ip4AndPort) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.Port != 0 {
- i = encodeVarintNebula(dAtA, i, uint64(m.Port))
- i--
- dAtA[i] = 0x10
- }
- if m.Ip != 0 {
- i = encodeVarintNebula(dAtA, i, uint64(m.Ip))
- i--
- dAtA[i] = 0x8
- }
- return len(dAtA) - i, nil
- }
- func (m *Ip6AndPort) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalToSizedBuffer(dAtA[:size])
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
- }
- func (m *Ip6AndPort) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
- }
- func (m *Ip6AndPort) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.Port != 0 {
- i = encodeVarintNebula(dAtA, i, uint64(m.Port))
- i--
- dAtA[i] = 0x18
- }
- if m.Lo != 0 {
- i = encodeVarintNebula(dAtA, i, uint64(m.Lo))
- i--
- dAtA[i] = 0x10
- }
- if m.Hi != 0 {
- i = encodeVarintNebula(dAtA, i, uint64(m.Hi))
- i--
- dAtA[i] = 0x8
- }
- return len(dAtA) - i, nil
- }
- func (m *NebulaPing) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalToSizedBuffer(dAtA[:size])
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
- }
- func (m *NebulaPing) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
- }
- func (m *NebulaPing) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.Time != 0 {
- i = encodeVarintNebula(dAtA, i, uint64(m.Time))
- i--
- dAtA[i] = 0x10
- }
- if m.Type != 0 {
- i = encodeVarintNebula(dAtA, i, uint64(m.Type))
- i--
- dAtA[i] = 0x8
- }
- return len(dAtA) - i, nil
- }
- func (m *NebulaHandshake) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalToSizedBuffer(dAtA[:size])
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
- }
- func (m *NebulaHandshake) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
- }
- func (m *NebulaHandshake) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if len(m.Hmac) > 0 {
- i -= len(m.Hmac)
- copy(dAtA[i:], m.Hmac)
- i = encodeVarintNebula(dAtA, i, uint64(len(m.Hmac)))
- i--
- dAtA[i] = 0x12
- }
- if m.Details != nil {
- {
- size, err := m.Details.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintNebula(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
- }
- func (m *NebulaHandshakeDetails) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalToSizedBuffer(dAtA[:size])
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
- }
- func (m *NebulaHandshakeDetails) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
- }
- func (m *NebulaHandshakeDetails) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.Time != 0 {
- i = encodeVarintNebula(dAtA, i, uint64(m.Time))
- i--
- dAtA[i] = 0x28
- }
- if m.Cookie != 0 {
- i = encodeVarintNebula(dAtA, i, uint64(m.Cookie))
- i--
- dAtA[i] = 0x20
- }
- if m.ResponderIndex != 0 {
- i = encodeVarintNebula(dAtA, i, uint64(m.ResponderIndex))
- i--
- dAtA[i] = 0x18
- }
- if m.InitiatorIndex != 0 {
- i = encodeVarintNebula(dAtA, i, uint64(m.InitiatorIndex))
- i--
- dAtA[i] = 0x10
- }
- if len(m.Cert) > 0 {
- i -= len(m.Cert)
- copy(dAtA[i:], m.Cert)
- i = encodeVarintNebula(dAtA, i, uint64(len(m.Cert)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
- }
- func (m *NebulaControl) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalToSizedBuffer(dAtA[:size])
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
- }
- func (m *NebulaControl) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
- }
- func (m *NebulaControl) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.RelayFromIp != 0 {
- i = encodeVarintNebula(dAtA, i, uint64(m.RelayFromIp))
- i--
- dAtA[i] = 0x28
- }
- if m.RelayToIp != 0 {
- i = encodeVarintNebula(dAtA, i, uint64(m.RelayToIp))
- i--
- dAtA[i] = 0x20
- }
- if m.ResponderRelayIndex != 0 {
- i = encodeVarintNebula(dAtA, i, uint64(m.ResponderRelayIndex))
- i--
- dAtA[i] = 0x18
- }
- if m.InitiatorRelayIndex != 0 {
- i = encodeVarintNebula(dAtA, i, uint64(m.InitiatorRelayIndex))
- i--
- dAtA[i] = 0x10
- }
- if m.Type != 0 {
- i = encodeVarintNebula(dAtA, i, uint64(m.Type))
- i--
- dAtA[i] = 0x8
- }
- return len(dAtA) - i, nil
- }
- func encodeVarintNebula(dAtA []byte, offset int, v uint64) int {
- offset -= sovNebula(v)
- base := offset
- for v >= 1<<7 {
- dAtA[offset] = uint8(v&0x7f | 0x80)
- v >>= 7
- offset++
- }
- dAtA[offset] = uint8(v)
- return base
- }
- func (m *NebulaMeta) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.Type != 0 {
- n += 1 + sovNebula(uint64(m.Type))
- }
- if m.Details != nil {
- l = m.Details.Size()
- n += 1 + l + sovNebula(uint64(l))
- }
- return n
- }
- func (m *NebulaMetaDetails) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.VpnIp != 0 {
- n += 1 + sovNebula(uint64(m.VpnIp))
- }
- if len(m.Ip4AndPorts) > 0 {
- for _, e := range m.Ip4AndPorts {
- l = e.Size()
- n += 1 + l + sovNebula(uint64(l))
- }
- }
- if m.Counter != 0 {
- n += 1 + sovNebula(uint64(m.Counter))
- }
- if len(m.Ip6AndPorts) > 0 {
- for _, e := range m.Ip6AndPorts {
- l = e.Size()
- n += 1 + l + sovNebula(uint64(l))
- }
- }
- if len(m.RelayVpnIp) > 0 {
- l = 0
- for _, e := range m.RelayVpnIp {
- l += sovNebula(uint64(e))
- }
- n += 1 + sovNebula(uint64(l)) + l
- }
- return n
- }
- func (m *Ip4AndPort) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.Ip != 0 {
- n += 1 + sovNebula(uint64(m.Ip))
- }
- if m.Port != 0 {
- n += 1 + sovNebula(uint64(m.Port))
- }
- return n
- }
- func (m *Ip6AndPort) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.Hi != 0 {
- n += 1 + sovNebula(uint64(m.Hi))
- }
- if m.Lo != 0 {
- n += 1 + sovNebula(uint64(m.Lo))
- }
- if m.Port != 0 {
- n += 1 + sovNebula(uint64(m.Port))
- }
- return n
- }
- func (m *NebulaPing) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.Type != 0 {
- n += 1 + sovNebula(uint64(m.Type))
- }
- if m.Time != 0 {
- n += 1 + sovNebula(uint64(m.Time))
- }
- return n
- }
- func (m *NebulaHandshake) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.Details != nil {
- l = m.Details.Size()
- n += 1 + l + sovNebula(uint64(l))
- }
- l = len(m.Hmac)
- if l > 0 {
- n += 1 + l + sovNebula(uint64(l))
- }
- return n
- }
- func (m *NebulaHandshakeDetails) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Cert)
- if l > 0 {
- n += 1 + l + sovNebula(uint64(l))
- }
- if m.InitiatorIndex != 0 {
- n += 1 + sovNebula(uint64(m.InitiatorIndex))
- }
- if m.ResponderIndex != 0 {
- n += 1 + sovNebula(uint64(m.ResponderIndex))
- }
- if m.Cookie != 0 {
- n += 1 + sovNebula(uint64(m.Cookie))
- }
- if m.Time != 0 {
- n += 1 + sovNebula(uint64(m.Time))
- }
- return n
- }
- func (m *NebulaControl) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.Type != 0 {
- n += 1 + sovNebula(uint64(m.Type))
- }
- if m.InitiatorRelayIndex != 0 {
- n += 1 + sovNebula(uint64(m.InitiatorRelayIndex))
- }
- if m.ResponderRelayIndex != 0 {
- n += 1 + sovNebula(uint64(m.ResponderRelayIndex))
- }
- if m.RelayToIp != 0 {
- n += 1 + sovNebula(uint64(m.RelayToIp))
- }
- if m.RelayFromIp != 0 {
- n += 1 + sovNebula(uint64(m.RelayFromIp))
- }
- return n
- }
- func sovNebula(x uint64) (n int) {
- return (math_bits.Len64(x|1) + 6) / 7
- }
- func sozNebula(x uint64) (n int) {
- return sovNebula(uint64((x << 1) ^ uint64((int64(x) >> 63))))
- }
- func (m *NebulaMeta) Unmarshal(dAtA []byte) error {
- l := len(dAtA)
- iNdEx := 0
- for iNdEx < l {
- preIndex := iNdEx
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowNebula
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- if wireType == 4 {
- return fmt.Errorf("proto: NebulaMeta: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: NebulaMeta: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
- }
- m.Type = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowNebula
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Type |= NebulaMeta_MessageType(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Details", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowNebula
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthNebula
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthNebula
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Details == nil {
- m.Details = &NebulaMetaDetails{}
- }
- if err := m.Details.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipNebula(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if (skippy < 0) || (iNdEx+skippy) < 0 {
- return ErrInvalidLengthNebula
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
- }
- func (m *NebulaMetaDetails) Unmarshal(dAtA []byte) error {
- l := len(dAtA)
- iNdEx := 0
- for iNdEx < l {
- preIndex := iNdEx
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowNebula
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- if wireType == 4 {
- return fmt.Errorf("proto: NebulaMetaDetails: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: NebulaMetaDetails: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field VpnIp", wireType)
- }
- m.VpnIp = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowNebula
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.VpnIp |= uint32(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Ip4AndPorts", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowNebula
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthNebula
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthNebula
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Ip4AndPorts = append(m.Ip4AndPorts, &Ip4AndPort{})
- if err := m.Ip4AndPorts[len(m.Ip4AndPorts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 3:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Counter", wireType)
- }
- m.Counter = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowNebula
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Counter |= uint32(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 4:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Ip6AndPorts", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowNebula
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthNebula
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthNebula
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Ip6AndPorts = append(m.Ip6AndPorts, &Ip6AndPort{})
- if err := m.Ip6AndPorts[len(m.Ip6AndPorts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 5:
- if wireType == 0 {
- var v uint32
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowNebula
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- v |= uint32(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- m.RelayVpnIp = append(m.RelayVpnIp, v)
- } else if wireType == 2 {
- var packedLen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowNebula
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- packedLen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if packedLen < 0 {
- return ErrInvalidLengthNebula
- }
- postIndex := iNdEx + packedLen
- if postIndex < 0 {
- return ErrInvalidLengthNebula
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- var elementCount int
- var count int
- for _, integer := range dAtA[iNdEx:postIndex] {
- if integer < 128 {
- count++
- }
- }
- elementCount = count
- if elementCount != 0 && len(m.RelayVpnIp) == 0 {
- m.RelayVpnIp = make([]uint32, 0, elementCount)
- }
- for iNdEx < postIndex {
- var v uint32
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowNebula
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- v |= uint32(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- m.RelayVpnIp = append(m.RelayVpnIp, v)
- }
- } else {
- return fmt.Errorf("proto: wrong wireType = %d for field RelayVpnIp", wireType)
- }
- default:
- iNdEx = preIndex
- skippy, err := skipNebula(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if (skippy < 0) || (iNdEx+skippy) < 0 {
- return ErrInvalidLengthNebula
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
- }
- func (m *Ip4AndPort) Unmarshal(dAtA []byte) error {
- l := len(dAtA)
- iNdEx := 0
- for iNdEx < l {
- preIndex := iNdEx
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowNebula
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- if wireType == 4 {
- return fmt.Errorf("proto: Ip4AndPort: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: Ip4AndPort: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Ip", wireType)
- }
- m.Ip = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowNebula
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Ip |= uint32(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 2:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType)
- }
- m.Port = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowNebula
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Port |= uint32(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- default:
- iNdEx = preIndex
- skippy, err := skipNebula(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if (skippy < 0) || (iNdEx+skippy) < 0 {
- return ErrInvalidLengthNebula
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
- }
- func (m *Ip6AndPort) Unmarshal(dAtA []byte) error {
- l := len(dAtA)
- iNdEx := 0
- for iNdEx < l {
- preIndex := iNdEx
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowNebula
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- if wireType == 4 {
- return fmt.Errorf("proto: Ip6AndPort: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: Ip6AndPort: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Hi", wireType)
- }
- m.Hi = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowNebula
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Hi |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 2:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Lo", wireType)
- }
- m.Lo = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowNebula
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Lo |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 3:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType)
- }
- m.Port = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowNebula
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Port |= uint32(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- default:
- iNdEx = preIndex
- skippy, err := skipNebula(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if (skippy < 0) || (iNdEx+skippy) < 0 {
- return ErrInvalidLengthNebula
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
- }
- func (m *NebulaPing) Unmarshal(dAtA []byte) error {
- l := len(dAtA)
- iNdEx := 0
- for iNdEx < l {
- preIndex := iNdEx
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowNebula
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- if wireType == 4 {
- return fmt.Errorf("proto: NebulaPing: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: NebulaPing: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
- }
- m.Type = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowNebula
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Type |= NebulaPing_MessageType(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 2:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Time", wireType)
- }
- m.Time = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowNebula
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Time |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- default:
- iNdEx = preIndex
- skippy, err := skipNebula(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if (skippy < 0) || (iNdEx+skippy) < 0 {
- return ErrInvalidLengthNebula
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
- }
- func (m *NebulaHandshake) Unmarshal(dAtA []byte) error {
- l := len(dAtA)
- iNdEx := 0
- for iNdEx < l {
- preIndex := iNdEx
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowNebula
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- if wireType == 4 {
- return fmt.Errorf("proto: NebulaHandshake: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: NebulaHandshake: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Details", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowNebula
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthNebula
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthNebula
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Details == nil {
- m.Details = &NebulaHandshakeDetails{}
- }
- if err := m.Details.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Hmac", wireType)
- }
- var byteLen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowNebula
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- byteLen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if byteLen < 0 {
- return ErrInvalidLengthNebula
- }
- postIndex := iNdEx + byteLen
- if postIndex < 0 {
- return ErrInvalidLengthNebula
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Hmac = append(m.Hmac[:0], dAtA[iNdEx:postIndex]...)
- if m.Hmac == nil {
- m.Hmac = []byte{}
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipNebula(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if (skippy < 0) || (iNdEx+skippy) < 0 {
- return ErrInvalidLengthNebula
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
- }
- func (m *NebulaHandshakeDetails) Unmarshal(dAtA []byte) error {
- l := len(dAtA)
- iNdEx := 0
- for iNdEx < l {
- preIndex := iNdEx
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowNebula
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- if wireType == 4 {
- return fmt.Errorf("proto: NebulaHandshakeDetails: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: NebulaHandshakeDetails: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Cert", wireType)
- }
- var byteLen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowNebula
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- byteLen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if byteLen < 0 {
- return ErrInvalidLengthNebula
- }
- postIndex := iNdEx + byteLen
- if postIndex < 0 {
- return ErrInvalidLengthNebula
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Cert = append(m.Cert[:0], dAtA[iNdEx:postIndex]...)
- if m.Cert == nil {
- m.Cert = []byte{}
- }
- iNdEx = postIndex
- case 2:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field InitiatorIndex", wireType)
- }
- m.InitiatorIndex = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowNebula
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.InitiatorIndex |= uint32(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 3:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field ResponderIndex", wireType)
- }
- m.ResponderIndex = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowNebula
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.ResponderIndex |= uint32(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 4:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Cookie", wireType)
- }
- m.Cookie = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowNebula
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Cookie |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 5:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Time", wireType)
- }
- m.Time = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowNebula
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Time |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- default:
- iNdEx = preIndex
- skippy, err := skipNebula(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if (skippy < 0) || (iNdEx+skippy) < 0 {
- return ErrInvalidLengthNebula
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
- }
- func (m *NebulaControl) Unmarshal(dAtA []byte) error {
- l := len(dAtA)
- iNdEx := 0
- for iNdEx < l {
- preIndex := iNdEx
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowNebula
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- if wireType == 4 {
- return fmt.Errorf("proto: NebulaControl: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: NebulaControl: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
- }
- m.Type = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowNebula
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Type |= NebulaControl_MessageType(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 2:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field InitiatorRelayIndex", wireType)
- }
- m.InitiatorRelayIndex = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowNebula
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.InitiatorRelayIndex |= uint32(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 3:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field ResponderRelayIndex", wireType)
- }
- m.ResponderRelayIndex = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowNebula
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.ResponderRelayIndex |= uint32(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 4:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field RelayToIp", wireType)
- }
- m.RelayToIp = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowNebula
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.RelayToIp |= uint32(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 5:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field RelayFromIp", wireType)
- }
- m.RelayFromIp = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowNebula
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.RelayFromIp |= uint32(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- default:
- iNdEx = preIndex
- skippy, err := skipNebula(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if (skippy < 0) || (iNdEx+skippy) < 0 {
- return ErrInvalidLengthNebula
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
- }
- func skipNebula(dAtA []byte) (n int, err error) {
- l := len(dAtA)
- iNdEx := 0
- depth := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowNebula
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- wireType := int(wire & 0x7)
- switch wireType {
- case 0:
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowNebula
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- iNdEx++
- if dAtA[iNdEx-1] < 0x80 {
- break
- }
- }
- case 1:
- iNdEx += 8
- case 2:
- var length int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowNebula
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- length |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if length < 0 {
- return 0, ErrInvalidLengthNebula
- }
- iNdEx += length
- case 3:
- depth++
- case 4:
- if depth == 0 {
- return 0, ErrUnexpectedEndOfGroupNebula
- }
- depth--
- case 5:
- iNdEx += 4
- default:
- return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
- }
- if iNdEx < 0 {
- return 0, ErrInvalidLengthNebula
- }
- if depth == 0 {
- return iNdEx, nil
- }
- }
- return 0, io.ErrUnexpectedEOF
- }
- var (
- ErrInvalidLengthNebula = fmt.Errorf("proto: negative length found during unmarshaling")
- ErrIntOverflowNebula = fmt.Errorf("proto: integer overflow")
- ErrUnexpectedEndOfGroupNebula = fmt.Errorf("proto: unexpected end of group")
- )
|