mqtt_easyjson.go 50 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273
  1. // Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT.
  2. package models
  3. import (
  4. json "encoding/json"
  5. easyjson "github.com/mailru/easyjson"
  6. jlexer "github.com/mailru/easyjson/jlexer"
  7. jwriter "github.com/mailru/easyjson/jwriter"
  8. wgtypes "golang.zx2c4.com/wireguard/wgctrl/wgtypes"
  9. net "net"
  10. netip "net/netip"
  11. time "time"
  12. )
  13. // suppress unused package warning
  14. var (
  15. _ *json.RawMessage
  16. _ *jlexer.Lexer
  17. _ *jwriter.Writer
  18. _ easyjson.Marshaler
  19. )
  20. func easyjsonDa059d96DecodeGithubComGravitlNetmakerModels(in *jlexer.Lexer, out *HostPeerUpdate) {
  21. isTopLevel := in.IsStart()
  22. if in.IsNull() {
  23. if isTopLevel {
  24. in.Consumed()
  25. }
  26. in.Skip()
  27. return
  28. }
  29. in.Delim('{')
  30. for !in.IsDelim('}') {
  31. key := in.UnsafeFieldName(false)
  32. in.WantColon()
  33. if in.IsNull() {
  34. in.Skip()
  35. in.WantComma()
  36. continue
  37. }
  38. switch key {
  39. case "host":
  40. easyjsonDa059d96DecodeGithubComGravitlNetmakerModels1(in, &out.Host)
  41. case "server":
  42. out.Server = string(in.String())
  43. case "serverversion":
  44. out.ServerVersion = string(in.String())
  45. case "serveraddrs":
  46. if in.IsNull() {
  47. in.Skip()
  48. out.ServerAddrs = nil
  49. } else {
  50. in.Delim('[')
  51. if out.ServerAddrs == nil {
  52. if !in.IsDelim(']') {
  53. out.ServerAddrs = make([]ServerAddr, 0, 2)
  54. } else {
  55. out.ServerAddrs = []ServerAddr{}
  56. }
  57. } else {
  58. out.ServerAddrs = (out.ServerAddrs)[:0]
  59. }
  60. for !in.IsDelim(']') {
  61. var v1 ServerAddr
  62. easyjsonDa059d96DecodeGithubComGravitlNetmakerModels2(in, &v1)
  63. out.ServerAddrs = append(out.ServerAddrs, v1)
  64. in.WantComma()
  65. }
  66. in.Delim(']')
  67. }
  68. case "peers":
  69. if in.IsNull() {
  70. in.Skip()
  71. out.NodePeers = nil
  72. } else {
  73. in.Delim('[')
  74. if out.NodePeers == nil {
  75. if !in.IsDelim(']') {
  76. out.NodePeers = make([]wgtypes.PeerConfig, 0, 0)
  77. } else {
  78. out.NodePeers = []wgtypes.PeerConfig{}
  79. }
  80. } else {
  81. out.NodePeers = (out.NodePeers)[:0]
  82. }
  83. for !in.IsDelim(']') {
  84. var v2 wgtypes.PeerConfig
  85. easyjsonDa059d96DecodeGolangZx2c4ComWireguardWgctrlWgtypes(in, &v2)
  86. out.NodePeers = append(out.NodePeers, v2)
  87. in.WantComma()
  88. }
  89. in.Delim(']')
  90. }
  91. case "Peers":
  92. if in.IsNull() {
  93. in.Skip()
  94. out.Peers = nil
  95. } else {
  96. in.Delim('[')
  97. if out.Peers == nil {
  98. if !in.IsDelim(']') {
  99. out.Peers = make([]wgtypes.PeerConfig, 0, 0)
  100. } else {
  101. out.Peers = []wgtypes.PeerConfig{}
  102. }
  103. } else {
  104. out.Peers = (out.Peers)[:0]
  105. }
  106. for !in.IsDelim(']') {
  107. var v3 wgtypes.PeerConfig
  108. easyjsonDa059d96DecodeGolangZx2c4ComWireguardWgctrlWgtypes(in, &v3)
  109. out.Peers = append(out.Peers, v3)
  110. in.WantComma()
  111. }
  112. in.Delim(']')
  113. }
  114. case "hostpeerids":
  115. if in.IsNull() {
  116. in.Skip()
  117. } else {
  118. in.Delim('{')
  119. out.HostPeerIDs = make(HostPeerMap)
  120. for !in.IsDelim('}') {
  121. key := string(in.String())
  122. in.WantColon()
  123. var v4 map[string]IDandAddr
  124. if in.IsNull() {
  125. in.Skip()
  126. } else {
  127. in.Delim('{')
  128. v4 = make(map[string]IDandAddr)
  129. for !in.IsDelim('}') {
  130. key := string(in.String())
  131. in.WantColon()
  132. var v5 IDandAddr
  133. easyjsonDa059d96DecodeGithubComGravitlNetmakerModels3(in, &v5)
  134. (v4)[key] = v5
  135. in.WantComma()
  136. }
  137. in.Delim('}')
  138. }
  139. (out.HostPeerIDs)[key] = v4
  140. in.WantComma()
  141. }
  142. in.Delim('}')
  143. }
  144. case "proxy_update":
  145. easyjsonDa059d96DecodeGithubComGravitlNetmakerModels4(in, &out.ProxyUpdate)
  146. case "egress_info":
  147. if in.IsNull() {
  148. in.Skip()
  149. } else {
  150. in.Delim('{')
  151. out.EgressInfo = make(map[string]EgressInfo)
  152. for !in.IsDelim('}') {
  153. key := string(in.String())
  154. in.WantColon()
  155. var v6 EgressInfo
  156. easyjsonDa059d96DecodeGithubComGravitlNetmakerModels5(in, &v6)
  157. (out.EgressInfo)[key] = v6
  158. in.WantComma()
  159. }
  160. in.Delim('}')
  161. }
  162. case "ingress_info":
  163. easyjsonDa059d96DecodeGithubComGravitlNetmakerModels6(in, &out.IngressInfo)
  164. case "peerids":
  165. if in.IsNull() {
  166. in.Skip()
  167. } else {
  168. in.Delim('{')
  169. out.PeerIDs = make(PeerMap)
  170. for !in.IsDelim('}') {
  171. key := string(in.String())
  172. in.WantColon()
  173. var v7 IDandAddr
  174. easyjsonDa059d96DecodeGithubComGravitlNetmakerModels3(in, &v7)
  175. (out.PeerIDs)[key] = v7
  176. in.WantComma()
  177. }
  178. in.Delim('}')
  179. }
  180. case "host_network_info":
  181. if in.IsNull() {
  182. in.Skip()
  183. } else {
  184. in.Delim('{')
  185. if !in.IsDelim('}') {
  186. out.HostNetworkInfo = make(HostInfoMap)
  187. } else {
  188. out.HostNetworkInfo = nil
  189. }
  190. for !in.IsDelim('}') {
  191. key := string(in.String())
  192. in.WantColon()
  193. var v8 HostNetworkInfo
  194. easyjsonDa059d96DecodeGithubComGravitlNetmakerModels7(in, &v8)
  195. (out.HostNetworkInfo)[key] = v8
  196. in.WantComma()
  197. }
  198. in.Delim('}')
  199. }
  200. default:
  201. in.SkipRecursive()
  202. }
  203. in.WantComma()
  204. }
  205. in.Delim('}')
  206. if isTopLevel {
  207. in.Consumed()
  208. }
  209. }
  210. func easyjsonDa059d96EncodeGithubComGravitlNetmakerModels(out *jwriter.Writer, in HostPeerUpdate) {
  211. out.RawByte('{')
  212. first := true
  213. _ = first
  214. {
  215. const prefix string = ",\"host\":"
  216. out.RawString(prefix[1:])
  217. easyjsonDa059d96EncodeGithubComGravitlNetmakerModels1(out, in.Host)
  218. }
  219. {
  220. const prefix string = ",\"server\":"
  221. out.RawString(prefix)
  222. out.String(string(in.Server))
  223. }
  224. {
  225. const prefix string = ",\"serverversion\":"
  226. out.RawString(prefix)
  227. out.String(string(in.ServerVersion))
  228. }
  229. {
  230. const prefix string = ",\"serveraddrs\":"
  231. out.RawString(prefix)
  232. if in.ServerAddrs == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
  233. out.RawString("null")
  234. } else {
  235. out.RawByte('[')
  236. for v9, v10 := range in.ServerAddrs {
  237. if v9 > 0 {
  238. out.RawByte(',')
  239. }
  240. easyjsonDa059d96EncodeGithubComGravitlNetmakerModels2(out, v10)
  241. }
  242. out.RawByte(']')
  243. }
  244. }
  245. {
  246. const prefix string = ",\"peers\":"
  247. out.RawString(prefix)
  248. if in.NodePeers == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
  249. out.RawString("null")
  250. } else {
  251. out.RawByte('[')
  252. for v11, v12 := range in.NodePeers {
  253. if v11 > 0 {
  254. out.RawByte(',')
  255. }
  256. easyjsonDa059d96EncodeGolangZx2c4ComWireguardWgctrlWgtypes(out, v12)
  257. }
  258. out.RawByte(']')
  259. }
  260. }
  261. {
  262. const prefix string = ",\"Peers\":"
  263. out.RawString(prefix)
  264. if in.Peers == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
  265. out.RawString("null")
  266. } else {
  267. out.RawByte('[')
  268. for v13, v14 := range in.Peers {
  269. if v13 > 0 {
  270. out.RawByte(',')
  271. }
  272. easyjsonDa059d96EncodeGolangZx2c4ComWireguardWgctrlWgtypes(out, v14)
  273. }
  274. out.RawByte(']')
  275. }
  276. }
  277. {
  278. const prefix string = ",\"hostpeerids\":"
  279. out.RawString(prefix)
  280. if in.HostPeerIDs == nil && (out.Flags&jwriter.NilMapAsEmpty) == 0 {
  281. out.RawString(`null`)
  282. } else {
  283. out.RawByte('{')
  284. v15First := true
  285. for v15Name, v15Value := range in.HostPeerIDs {
  286. if v15First {
  287. v15First = false
  288. } else {
  289. out.RawByte(',')
  290. }
  291. out.String(string(v15Name))
  292. out.RawByte(':')
  293. if v15Value == nil && (out.Flags&jwriter.NilMapAsEmpty) == 0 {
  294. out.RawString(`null`)
  295. } else {
  296. out.RawByte('{')
  297. v16First := true
  298. for v16Name, v16Value := range v15Value {
  299. if v16First {
  300. v16First = false
  301. } else {
  302. out.RawByte(',')
  303. }
  304. out.String(string(v16Name))
  305. out.RawByte(':')
  306. easyjsonDa059d96EncodeGithubComGravitlNetmakerModels3(out, v16Value)
  307. }
  308. out.RawByte('}')
  309. }
  310. }
  311. out.RawByte('}')
  312. }
  313. }
  314. {
  315. const prefix string = ",\"proxy_update\":"
  316. out.RawString(prefix)
  317. easyjsonDa059d96EncodeGithubComGravitlNetmakerModels4(out, in.ProxyUpdate)
  318. }
  319. {
  320. const prefix string = ",\"egress_info\":"
  321. out.RawString(prefix)
  322. if in.EgressInfo == nil && (out.Flags&jwriter.NilMapAsEmpty) == 0 {
  323. out.RawString(`null`)
  324. } else {
  325. out.RawByte('{')
  326. v17First := true
  327. for v17Name, v17Value := range in.EgressInfo {
  328. if v17First {
  329. v17First = false
  330. } else {
  331. out.RawByte(',')
  332. }
  333. out.String(string(v17Name))
  334. out.RawByte(':')
  335. easyjsonDa059d96EncodeGithubComGravitlNetmakerModels5(out, v17Value)
  336. }
  337. out.RawByte('}')
  338. }
  339. }
  340. {
  341. const prefix string = ",\"ingress_info\":"
  342. out.RawString(prefix)
  343. easyjsonDa059d96EncodeGithubComGravitlNetmakerModels6(out, in.IngressInfo)
  344. }
  345. {
  346. const prefix string = ",\"peerids\":"
  347. out.RawString(prefix)
  348. if in.PeerIDs == nil && (out.Flags&jwriter.NilMapAsEmpty) == 0 {
  349. out.RawString(`null`)
  350. } else {
  351. out.RawByte('{')
  352. v18First := true
  353. for v18Name, v18Value := range in.PeerIDs {
  354. if v18First {
  355. v18First = false
  356. } else {
  357. out.RawByte(',')
  358. }
  359. out.String(string(v18Name))
  360. out.RawByte(':')
  361. easyjsonDa059d96EncodeGithubComGravitlNetmakerModels3(out, v18Value)
  362. }
  363. out.RawByte('}')
  364. }
  365. }
  366. if len(in.HostNetworkInfo) != 0 {
  367. const prefix string = ",\"host_network_info\":"
  368. out.RawString(prefix)
  369. {
  370. out.RawByte('{')
  371. v19First := true
  372. for v19Name, v19Value := range in.HostNetworkInfo {
  373. if v19First {
  374. v19First = false
  375. } else {
  376. out.RawByte(',')
  377. }
  378. out.String(string(v19Name))
  379. out.RawByte(':')
  380. easyjsonDa059d96EncodeGithubComGravitlNetmakerModels7(out, v19Value)
  381. }
  382. out.RawByte('}')
  383. }
  384. }
  385. out.RawByte('}')
  386. }
  387. // MarshalJSON supports json.Marshaler interface
  388. func (v HostPeerUpdate) MarshalJSON() ([]byte, error) {
  389. w := jwriter.Writer{}
  390. easyjsonDa059d96EncodeGithubComGravitlNetmakerModels(&w, v)
  391. return w.Buffer.BuildBytes(), w.Error
  392. }
  393. // MarshalEasyJSON supports easyjson.Marshaler interface
  394. func (v HostPeerUpdate) MarshalEasyJSON(w *jwriter.Writer) {
  395. easyjsonDa059d96EncodeGithubComGravitlNetmakerModels(w, v)
  396. }
  397. // UnmarshalJSON supports json.Unmarshaler interface
  398. func (v *HostPeerUpdate) UnmarshalJSON(data []byte) error {
  399. r := jlexer.Lexer{Data: data}
  400. easyjsonDa059d96DecodeGithubComGravitlNetmakerModels(&r, v)
  401. return r.Error()
  402. }
  403. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  404. func (v *HostPeerUpdate) UnmarshalEasyJSON(l *jlexer.Lexer) {
  405. easyjsonDa059d96DecodeGithubComGravitlNetmakerModels(l, v)
  406. }
  407. func easyjsonDa059d96DecodeGithubComGravitlNetmakerModels7(in *jlexer.Lexer, out *HostNetworkInfo) {
  408. isTopLevel := in.IsStart()
  409. if in.IsNull() {
  410. if isTopLevel {
  411. in.Consumed()
  412. }
  413. in.Skip()
  414. return
  415. }
  416. in.Delim('{')
  417. for !in.IsDelim('}') {
  418. key := in.UnsafeFieldName(false)
  419. in.WantColon()
  420. if in.IsNull() {
  421. in.Skip()
  422. in.WantComma()
  423. continue
  424. }
  425. switch key {
  426. case "interfaces":
  427. if in.IsNull() {
  428. in.Skip()
  429. out.Interfaces = nil
  430. } else {
  431. in.Delim('[')
  432. if out.Interfaces == nil {
  433. if !in.IsDelim(']') {
  434. out.Interfaces = make([]Iface, 0, 0)
  435. } else {
  436. out.Interfaces = []Iface{}
  437. }
  438. } else {
  439. out.Interfaces = (out.Interfaces)[:0]
  440. }
  441. for !in.IsDelim(']') {
  442. var v20 Iface
  443. easyjsonDa059d96DecodeGithubComGravitlNetmakerModels8(in, &v20)
  444. out.Interfaces = append(out.Interfaces, v20)
  445. in.WantComma()
  446. }
  447. in.Delim(']')
  448. }
  449. case "proxy_listen_port":
  450. out.ProxyListenPort = int(in.Int())
  451. default:
  452. in.SkipRecursive()
  453. }
  454. in.WantComma()
  455. }
  456. in.Delim('}')
  457. if isTopLevel {
  458. in.Consumed()
  459. }
  460. }
  461. func easyjsonDa059d96EncodeGithubComGravitlNetmakerModels7(out *jwriter.Writer, in HostNetworkInfo) {
  462. out.RawByte('{')
  463. first := true
  464. _ = first
  465. {
  466. const prefix string = ",\"interfaces\":"
  467. out.RawString(prefix[1:])
  468. if in.Interfaces == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
  469. out.RawString("null")
  470. } else {
  471. out.RawByte('[')
  472. for v21, v22 := range in.Interfaces {
  473. if v21 > 0 {
  474. out.RawByte(',')
  475. }
  476. easyjsonDa059d96EncodeGithubComGravitlNetmakerModels8(out, v22)
  477. }
  478. out.RawByte(']')
  479. }
  480. }
  481. {
  482. const prefix string = ",\"proxy_listen_port\":"
  483. out.RawString(prefix)
  484. out.Int(int(in.ProxyListenPort))
  485. }
  486. out.RawByte('}')
  487. }
  488. func easyjsonDa059d96DecodeGithubComGravitlNetmakerModels8(in *jlexer.Lexer, out *Iface) {
  489. isTopLevel := in.IsStart()
  490. if in.IsNull() {
  491. if isTopLevel {
  492. in.Consumed()
  493. }
  494. in.Skip()
  495. return
  496. }
  497. in.Delim('{')
  498. for !in.IsDelim('}') {
  499. key := in.UnsafeFieldName(false)
  500. in.WantColon()
  501. if in.IsNull() {
  502. in.Skip()
  503. in.WantComma()
  504. continue
  505. }
  506. switch key {
  507. case "name":
  508. out.Name = string(in.String())
  509. case "address":
  510. easyjsonDa059d96DecodeNet(in, &out.Address)
  511. case "addressString":
  512. out.AddressString = string(in.String())
  513. default:
  514. in.SkipRecursive()
  515. }
  516. in.WantComma()
  517. }
  518. in.Delim('}')
  519. if isTopLevel {
  520. in.Consumed()
  521. }
  522. }
  523. func easyjsonDa059d96EncodeGithubComGravitlNetmakerModels8(out *jwriter.Writer, in Iface) {
  524. out.RawByte('{')
  525. first := true
  526. _ = first
  527. {
  528. const prefix string = ",\"name\":"
  529. out.RawString(prefix[1:])
  530. out.String(string(in.Name))
  531. }
  532. {
  533. const prefix string = ",\"address\":"
  534. out.RawString(prefix)
  535. easyjsonDa059d96EncodeNet(out, in.Address)
  536. }
  537. {
  538. const prefix string = ",\"addressString\":"
  539. out.RawString(prefix)
  540. out.String(string(in.AddressString))
  541. }
  542. out.RawByte('}')
  543. }
  544. func easyjsonDa059d96DecodeNet(in *jlexer.Lexer, out *net.IPNet) {
  545. isTopLevel := in.IsStart()
  546. if in.IsNull() {
  547. if isTopLevel {
  548. in.Consumed()
  549. }
  550. in.Skip()
  551. return
  552. }
  553. in.Delim('{')
  554. for !in.IsDelim('}') {
  555. key := in.UnsafeFieldName(false)
  556. in.WantColon()
  557. if in.IsNull() {
  558. in.Skip()
  559. in.WantComma()
  560. continue
  561. }
  562. switch key {
  563. case "IP":
  564. if data := in.UnsafeBytes(); in.Ok() {
  565. in.AddError((out.IP).UnmarshalText(data))
  566. }
  567. case "Mask":
  568. if in.IsNull() {
  569. in.Skip()
  570. out.Mask = nil
  571. } else {
  572. out.Mask = in.Bytes()
  573. }
  574. default:
  575. in.SkipRecursive()
  576. }
  577. in.WantComma()
  578. }
  579. in.Delim('}')
  580. if isTopLevel {
  581. in.Consumed()
  582. }
  583. }
  584. func easyjsonDa059d96EncodeNet(out *jwriter.Writer, in net.IPNet) {
  585. out.RawByte('{')
  586. first := true
  587. _ = first
  588. {
  589. const prefix string = ",\"IP\":"
  590. out.RawString(prefix[1:])
  591. out.RawText((in.IP).MarshalText())
  592. }
  593. {
  594. const prefix string = ",\"Mask\":"
  595. out.RawString(prefix)
  596. out.Base64Bytes(in.Mask)
  597. }
  598. out.RawByte('}')
  599. }
  600. func easyjsonDa059d96DecodeGithubComGravitlNetmakerModels6(in *jlexer.Lexer, out *IngressInfo) {
  601. isTopLevel := in.IsStart()
  602. if in.IsNull() {
  603. if isTopLevel {
  604. in.Consumed()
  605. }
  606. in.Skip()
  607. return
  608. }
  609. in.Delim('{')
  610. for !in.IsDelim('}') {
  611. key := in.UnsafeFieldName(false)
  612. in.WantColon()
  613. if in.IsNull() {
  614. in.Skip()
  615. in.WantComma()
  616. continue
  617. }
  618. switch key {
  619. case "ext_peers":
  620. if in.IsNull() {
  621. in.Skip()
  622. } else {
  623. in.Delim('{')
  624. out.ExtPeers = make(map[string]ExtClientInfo)
  625. for !in.IsDelim('}') {
  626. key := string(in.String())
  627. in.WantColon()
  628. var v26 ExtClientInfo
  629. easyjsonDa059d96DecodeGithubComGravitlNetmakerModels9(in, &v26)
  630. (out.ExtPeers)[key] = v26
  631. in.WantComma()
  632. }
  633. in.Delim('}')
  634. }
  635. case "egress_ranges":
  636. if in.IsNull() {
  637. in.Skip()
  638. out.EgressRanges = nil
  639. } else {
  640. in.Delim('[')
  641. if out.EgressRanges == nil {
  642. if !in.IsDelim(']') {
  643. out.EgressRanges = make([]string, 0, 4)
  644. } else {
  645. out.EgressRanges = []string{}
  646. }
  647. } else {
  648. out.EgressRanges = (out.EgressRanges)[:0]
  649. }
  650. for !in.IsDelim(']') {
  651. var v27 string
  652. v27 = string(in.String())
  653. out.EgressRanges = append(out.EgressRanges, v27)
  654. in.WantComma()
  655. }
  656. in.Delim(']')
  657. }
  658. default:
  659. in.SkipRecursive()
  660. }
  661. in.WantComma()
  662. }
  663. in.Delim('}')
  664. if isTopLevel {
  665. in.Consumed()
  666. }
  667. }
  668. func easyjsonDa059d96EncodeGithubComGravitlNetmakerModels6(out *jwriter.Writer, in IngressInfo) {
  669. out.RawByte('{')
  670. first := true
  671. _ = first
  672. {
  673. const prefix string = ",\"ext_peers\":"
  674. out.RawString(prefix[1:])
  675. if in.ExtPeers == nil && (out.Flags&jwriter.NilMapAsEmpty) == 0 {
  676. out.RawString(`null`)
  677. } else {
  678. out.RawByte('{')
  679. v28First := true
  680. for v28Name, v28Value := range in.ExtPeers {
  681. if v28First {
  682. v28First = false
  683. } else {
  684. out.RawByte(',')
  685. }
  686. out.String(string(v28Name))
  687. out.RawByte(':')
  688. easyjsonDa059d96EncodeGithubComGravitlNetmakerModels9(out, v28Value)
  689. }
  690. out.RawByte('}')
  691. }
  692. }
  693. {
  694. const prefix string = ",\"egress_ranges\":"
  695. out.RawString(prefix)
  696. if in.EgressRanges == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
  697. out.RawString("null")
  698. } else {
  699. out.RawByte('[')
  700. for v29, v30 := range in.EgressRanges {
  701. if v29 > 0 {
  702. out.RawByte(',')
  703. }
  704. out.String(string(v30))
  705. }
  706. out.RawByte(']')
  707. }
  708. }
  709. out.RawByte('}')
  710. }
  711. func easyjsonDa059d96DecodeGithubComGravitlNetmakerModels9(in *jlexer.Lexer, out *ExtClientInfo) {
  712. isTopLevel := in.IsStart()
  713. if in.IsNull() {
  714. if isTopLevel {
  715. in.Consumed()
  716. }
  717. in.Skip()
  718. return
  719. }
  720. in.Delim('{')
  721. for !in.IsDelim('}') {
  722. key := in.UnsafeFieldName(false)
  723. in.WantColon()
  724. if in.IsNull() {
  725. in.Skip()
  726. in.WantComma()
  727. continue
  728. }
  729. switch key {
  730. case "ingress_gw_addr":
  731. easyjsonDa059d96DecodeNet(in, &out.IngGwAddr)
  732. case "network":
  733. easyjsonDa059d96DecodeNet(in, &out.Network)
  734. case "masquerade":
  735. out.Masquerade = bool(in.Bool())
  736. case "ext_peer_addr":
  737. easyjsonDa059d96DecodeNet(in, &out.ExtPeerAddr)
  738. case "ext_peer_key":
  739. out.ExtPeerKey = string(in.String())
  740. case "peers":
  741. if in.IsNull() {
  742. in.Skip()
  743. } else {
  744. in.Delim('{')
  745. out.Peers = make(map[string]PeerRouteInfo)
  746. for !in.IsDelim('}') {
  747. key := string(in.String())
  748. in.WantColon()
  749. var v31 PeerRouteInfo
  750. easyjsonDa059d96DecodeGithubComGravitlNetmakerModels10(in, &v31)
  751. (out.Peers)[key] = v31
  752. in.WantComma()
  753. }
  754. in.Delim('}')
  755. }
  756. default:
  757. in.SkipRecursive()
  758. }
  759. in.WantComma()
  760. }
  761. in.Delim('}')
  762. if isTopLevel {
  763. in.Consumed()
  764. }
  765. }
  766. func easyjsonDa059d96EncodeGithubComGravitlNetmakerModels9(out *jwriter.Writer, in ExtClientInfo) {
  767. out.RawByte('{')
  768. first := true
  769. _ = first
  770. {
  771. const prefix string = ",\"ingress_gw_addr\":"
  772. out.RawString(prefix[1:])
  773. easyjsonDa059d96EncodeNet(out, in.IngGwAddr)
  774. }
  775. {
  776. const prefix string = ",\"network\":"
  777. out.RawString(prefix)
  778. easyjsonDa059d96EncodeNet(out, in.Network)
  779. }
  780. {
  781. const prefix string = ",\"masquerade\":"
  782. out.RawString(prefix)
  783. out.Bool(bool(in.Masquerade))
  784. }
  785. {
  786. const prefix string = ",\"ext_peer_addr\":"
  787. out.RawString(prefix)
  788. easyjsonDa059d96EncodeNet(out, in.ExtPeerAddr)
  789. }
  790. {
  791. const prefix string = ",\"ext_peer_key\":"
  792. out.RawString(prefix)
  793. out.String(string(in.ExtPeerKey))
  794. }
  795. {
  796. const prefix string = ",\"peers\":"
  797. out.RawString(prefix)
  798. if in.Peers == nil && (out.Flags&jwriter.NilMapAsEmpty) == 0 {
  799. out.RawString(`null`)
  800. } else {
  801. out.RawByte('{')
  802. v32First := true
  803. for v32Name, v32Value := range in.Peers {
  804. if v32First {
  805. v32First = false
  806. } else {
  807. out.RawByte(',')
  808. }
  809. out.String(string(v32Name))
  810. out.RawByte(':')
  811. easyjsonDa059d96EncodeGithubComGravitlNetmakerModels10(out, v32Value)
  812. }
  813. out.RawByte('}')
  814. }
  815. }
  816. out.RawByte('}')
  817. }
  818. func easyjsonDa059d96DecodeGithubComGravitlNetmakerModels10(in *jlexer.Lexer, out *PeerRouteInfo) {
  819. isTopLevel := in.IsStart()
  820. if in.IsNull() {
  821. if isTopLevel {
  822. in.Consumed()
  823. }
  824. in.Skip()
  825. return
  826. }
  827. in.Delim('{')
  828. for !in.IsDelim('}') {
  829. key := in.UnsafeFieldName(false)
  830. in.WantColon()
  831. if in.IsNull() {
  832. in.Skip()
  833. in.WantComma()
  834. continue
  835. }
  836. switch key {
  837. case "peer_addr":
  838. easyjsonDa059d96DecodeNet(in, &out.PeerAddr)
  839. case "peer_key":
  840. out.PeerKey = string(in.String())
  841. case "allow":
  842. out.Allow = bool(in.Bool())
  843. case "id":
  844. out.ID = string(in.String())
  845. default:
  846. in.SkipRecursive()
  847. }
  848. in.WantComma()
  849. }
  850. in.Delim('}')
  851. if isTopLevel {
  852. in.Consumed()
  853. }
  854. }
  855. func easyjsonDa059d96EncodeGithubComGravitlNetmakerModels10(out *jwriter.Writer, in PeerRouteInfo) {
  856. out.RawByte('{')
  857. first := true
  858. _ = first
  859. {
  860. const prefix string = ",\"peer_addr\":"
  861. out.RawString(prefix[1:])
  862. easyjsonDa059d96EncodeNet(out, in.PeerAddr)
  863. }
  864. {
  865. const prefix string = ",\"peer_key\":"
  866. out.RawString(prefix)
  867. out.String(string(in.PeerKey))
  868. }
  869. {
  870. const prefix string = ",\"allow\":"
  871. out.RawString(prefix)
  872. out.Bool(bool(in.Allow))
  873. }
  874. if in.ID != "" {
  875. const prefix string = ",\"id\":"
  876. out.RawString(prefix)
  877. out.String(string(in.ID))
  878. }
  879. out.RawByte('}')
  880. }
  881. func easyjsonDa059d96DecodeGithubComGravitlNetmakerModels5(in *jlexer.Lexer, out *EgressInfo) {
  882. isTopLevel := in.IsStart()
  883. if in.IsNull() {
  884. if isTopLevel {
  885. in.Consumed()
  886. }
  887. in.Skip()
  888. return
  889. }
  890. in.Delim('{')
  891. for !in.IsDelim('}') {
  892. key := in.UnsafeFieldName(false)
  893. in.WantColon()
  894. if in.IsNull() {
  895. in.Skip()
  896. in.WantComma()
  897. continue
  898. }
  899. switch key {
  900. case "egress_id":
  901. out.EgressID = string(in.String())
  902. case "network":
  903. easyjsonDa059d96DecodeNet(in, &out.Network)
  904. case "egress_gw_addr":
  905. easyjsonDa059d96DecodeNet(in, &out.EgressGwAddr)
  906. case "gateway_peers":
  907. if in.IsNull() {
  908. in.Skip()
  909. } else {
  910. in.Delim('{')
  911. out.GwPeers = make(map[string]PeerRouteInfo)
  912. for !in.IsDelim('}') {
  913. key := string(in.String())
  914. in.WantColon()
  915. var v33 PeerRouteInfo
  916. easyjsonDa059d96DecodeGithubComGravitlNetmakerModels10(in, &v33)
  917. (out.GwPeers)[key] = v33
  918. in.WantComma()
  919. }
  920. in.Delim('}')
  921. }
  922. case "egress_gateway_cfg":
  923. easyjsonDa059d96DecodeGithubComGravitlNetmakerModels11(in, &out.EgressGWCfg)
  924. default:
  925. in.SkipRecursive()
  926. }
  927. in.WantComma()
  928. }
  929. in.Delim('}')
  930. if isTopLevel {
  931. in.Consumed()
  932. }
  933. }
  934. func easyjsonDa059d96EncodeGithubComGravitlNetmakerModels5(out *jwriter.Writer, in EgressInfo) {
  935. out.RawByte('{')
  936. first := true
  937. _ = first
  938. {
  939. const prefix string = ",\"egress_id\":"
  940. out.RawString(prefix[1:])
  941. out.String(string(in.EgressID))
  942. }
  943. {
  944. const prefix string = ",\"network\":"
  945. out.RawString(prefix)
  946. easyjsonDa059d96EncodeNet(out, in.Network)
  947. }
  948. {
  949. const prefix string = ",\"egress_gw_addr\":"
  950. out.RawString(prefix)
  951. easyjsonDa059d96EncodeNet(out, in.EgressGwAddr)
  952. }
  953. {
  954. const prefix string = ",\"gateway_peers\":"
  955. out.RawString(prefix)
  956. if in.GwPeers == nil && (out.Flags&jwriter.NilMapAsEmpty) == 0 {
  957. out.RawString(`null`)
  958. } else {
  959. out.RawByte('{')
  960. v34First := true
  961. for v34Name, v34Value := range in.GwPeers {
  962. if v34First {
  963. v34First = false
  964. } else {
  965. out.RawByte(',')
  966. }
  967. out.String(string(v34Name))
  968. out.RawByte(':')
  969. easyjsonDa059d96EncodeGithubComGravitlNetmakerModels10(out, v34Value)
  970. }
  971. out.RawByte('}')
  972. }
  973. }
  974. {
  975. const prefix string = ",\"egress_gateway_cfg\":"
  976. out.RawString(prefix)
  977. easyjsonDa059d96EncodeGithubComGravitlNetmakerModels11(out, in.EgressGWCfg)
  978. }
  979. out.RawByte('}')
  980. }
  981. func easyjsonDa059d96DecodeGithubComGravitlNetmakerModels11(in *jlexer.Lexer, out *EgressGatewayRequest) {
  982. isTopLevel := in.IsStart()
  983. if in.IsNull() {
  984. if isTopLevel {
  985. in.Consumed()
  986. }
  987. in.Skip()
  988. return
  989. }
  990. in.Delim('{')
  991. for !in.IsDelim('}') {
  992. key := in.UnsafeFieldName(false)
  993. in.WantColon()
  994. if in.IsNull() {
  995. in.Skip()
  996. in.WantComma()
  997. continue
  998. }
  999. switch key {
  1000. case "nodeid":
  1001. out.NodeID = string(in.String())
  1002. case "netid":
  1003. out.NetID = string(in.String())
  1004. case "natenabled":
  1005. out.NatEnabled = string(in.String())
  1006. case "ranges":
  1007. if in.IsNull() {
  1008. in.Skip()
  1009. out.Ranges = nil
  1010. } else {
  1011. in.Delim('[')
  1012. if out.Ranges == nil {
  1013. if !in.IsDelim(']') {
  1014. out.Ranges = make([]string, 0, 4)
  1015. } else {
  1016. out.Ranges = []string{}
  1017. }
  1018. } else {
  1019. out.Ranges = (out.Ranges)[:0]
  1020. }
  1021. for !in.IsDelim(']') {
  1022. var v35 string
  1023. v35 = string(in.String())
  1024. out.Ranges = append(out.Ranges, v35)
  1025. in.WantComma()
  1026. }
  1027. in.Delim(']')
  1028. }
  1029. default:
  1030. in.SkipRecursive()
  1031. }
  1032. in.WantComma()
  1033. }
  1034. in.Delim('}')
  1035. if isTopLevel {
  1036. in.Consumed()
  1037. }
  1038. }
  1039. func easyjsonDa059d96EncodeGithubComGravitlNetmakerModels11(out *jwriter.Writer, in EgressGatewayRequest) {
  1040. out.RawByte('{')
  1041. first := true
  1042. _ = first
  1043. {
  1044. const prefix string = ",\"nodeid\":"
  1045. out.RawString(prefix[1:])
  1046. out.String(string(in.NodeID))
  1047. }
  1048. {
  1049. const prefix string = ",\"netid\":"
  1050. out.RawString(prefix)
  1051. out.String(string(in.NetID))
  1052. }
  1053. {
  1054. const prefix string = ",\"natenabled\":"
  1055. out.RawString(prefix)
  1056. out.String(string(in.NatEnabled))
  1057. }
  1058. {
  1059. const prefix string = ",\"ranges\":"
  1060. out.RawString(prefix)
  1061. if in.Ranges == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
  1062. out.RawString("null")
  1063. } else {
  1064. out.RawByte('[')
  1065. for v36, v37 := range in.Ranges {
  1066. if v36 > 0 {
  1067. out.RawByte(',')
  1068. }
  1069. out.String(string(v37))
  1070. }
  1071. out.RawByte(']')
  1072. }
  1073. }
  1074. out.RawByte('}')
  1075. }
  1076. func easyjsonDa059d96DecodeGithubComGravitlNetmakerModels4(in *jlexer.Lexer, out *ProxyManagerPayload) {
  1077. isTopLevel := in.IsStart()
  1078. if in.IsNull() {
  1079. if isTopLevel {
  1080. in.Consumed()
  1081. }
  1082. in.Skip()
  1083. return
  1084. }
  1085. in.Delim('{')
  1086. for !in.IsDelim('}') {
  1087. key := in.UnsafeFieldName(false)
  1088. in.WantColon()
  1089. if in.IsNull() {
  1090. in.Skip()
  1091. in.WantComma()
  1092. continue
  1093. }
  1094. switch key {
  1095. case "action":
  1096. out.Action = ProxyAction(in.String())
  1097. case "interface_name":
  1098. out.InterfaceName = string(in.String())
  1099. case "server":
  1100. out.Server = string(in.String())
  1101. case "peers":
  1102. if in.IsNull() {
  1103. in.Skip()
  1104. out.Peers = nil
  1105. } else {
  1106. in.Delim('[')
  1107. if out.Peers == nil {
  1108. if !in.IsDelim(']') {
  1109. out.Peers = make([]wgtypes.PeerConfig, 0, 0)
  1110. } else {
  1111. out.Peers = []wgtypes.PeerConfig{}
  1112. }
  1113. } else {
  1114. out.Peers = (out.Peers)[:0]
  1115. }
  1116. for !in.IsDelim(']') {
  1117. var v38 wgtypes.PeerConfig
  1118. easyjsonDa059d96DecodeGolangZx2c4ComWireguardWgctrlWgtypes(in, &v38)
  1119. out.Peers = append(out.Peers, v38)
  1120. in.WantComma()
  1121. }
  1122. in.Delim(']')
  1123. }
  1124. case "peer_map":
  1125. if in.IsNull() {
  1126. in.Skip()
  1127. } else {
  1128. in.Delim('{')
  1129. out.PeerMap = make(map[string]PeerConf)
  1130. for !in.IsDelim('}') {
  1131. key := string(in.String())
  1132. in.WantColon()
  1133. var v39 PeerConf
  1134. easyjsonDa059d96DecodeGithubComGravitlNetmakerModels12(in, &v39)
  1135. (out.PeerMap)[key] = v39
  1136. in.WantComma()
  1137. }
  1138. in.Delim('}')
  1139. }
  1140. case "is_ingress":
  1141. out.IsIngress = bool(in.Bool())
  1142. case "is_relayed":
  1143. out.IsRelayed = bool(in.Bool())
  1144. case "relayed_to":
  1145. if in.IsNull() {
  1146. in.Skip()
  1147. out.RelayedTo = nil
  1148. } else {
  1149. if out.RelayedTo == nil {
  1150. out.RelayedTo = new(net.UDPAddr)
  1151. }
  1152. easyjsonDa059d96DecodeNet1(in, out.RelayedTo)
  1153. }
  1154. case "is_relay":
  1155. out.IsRelay = bool(in.Bool())
  1156. case "relayed_conf":
  1157. if in.IsNull() {
  1158. in.Skip()
  1159. } else {
  1160. in.Delim('{')
  1161. out.RelayedPeerConf = make(map[string]RelayedConf)
  1162. for !in.IsDelim('}') {
  1163. key := string(in.String())
  1164. in.WantColon()
  1165. var v40 RelayedConf
  1166. easyjsonDa059d96DecodeGithubComGravitlNetmakerModels13(in, &v40)
  1167. (out.RelayedPeerConf)[key] = v40
  1168. in.WantComma()
  1169. }
  1170. in.Delim('}')
  1171. }
  1172. default:
  1173. in.SkipRecursive()
  1174. }
  1175. in.WantComma()
  1176. }
  1177. in.Delim('}')
  1178. if isTopLevel {
  1179. in.Consumed()
  1180. }
  1181. }
  1182. func easyjsonDa059d96EncodeGithubComGravitlNetmakerModels4(out *jwriter.Writer, in ProxyManagerPayload) {
  1183. out.RawByte('{')
  1184. first := true
  1185. _ = first
  1186. {
  1187. const prefix string = ",\"action\":"
  1188. out.RawString(prefix[1:])
  1189. out.String(string(in.Action))
  1190. }
  1191. {
  1192. const prefix string = ",\"interface_name\":"
  1193. out.RawString(prefix)
  1194. out.String(string(in.InterfaceName))
  1195. }
  1196. {
  1197. const prefix string = ",\"server\":"
  1198. out.RawString(prefix)
  1199. out.String(string(in.Server))
  1200. }
  1201. {
  1202. const prefix string = ",\"peers\":"
  1203. out.RawString(prefix)
  1204. if in.Peers == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
  1205. out.RawString("null")
  1206. } else {
  1207. out.RawByte('[')
  1208. for v41, v42 := range in.Peers {
  1209. if v41 > 0 {
  1210. out.RawByte(',')
  1211. }
  1212. easyjsonDa059d96EncodeGolangZx2c4ComWireguardWgctrlWgtypes(out, v42)
  1213. }
  1214. out.RawByte(']')
  1215. }
  1216. }
  1217. {
  1218. const prefix string = ",\"peer_map\":"
  1219. out.RawString(prefix)
  1220. if in.PeerMap == nil && (out.Flags&jwriter.NilMapAsEmpty) == 0 {
  1221. out.RawString(`null`)
  1222. } else {
  1223. out.RawByte('{')
  1224. v43First := true
  1225. for v43Name, v43Value := range in.PeerMap {
  1226. if v43First {
  1227. v43First = false
  1228. } else {
  1229. out.RawByte(',')
  1230. }
  1231. out.String(string(v43Name))
  1232. out.RawByte(':')
  1233. easyjsonDa059d96EncodeGithubComGravitlNetmakerModels12(out, v43Value)
  1234. }
  1235. out.RawByte('}')
  1236. }
  1237. }
  1238. {
  1239. const prefix string = ",\"is_ingress\":"
  1240. out.RawString(prefix)
  1241. out.Bool(bool(in.IsIngress))
  1242. }
  1243. {
  1244. const prefix string = ",\"is_relayed\":"
  1245. out.RawString(prefix)
  1246. out.Bool(bool(in.IsRelayed))
  1247. }
  1248. {
  1249. const prefix string = ",\"relayed_to\":"
  1250. out.RawString(prefix)
  1251. if in.RelayedTo == nil {
  1252. out.RawString("null")
  1253. } else {
  1254. easyjsonDa059d96EncodeNet1(out, *in.RelayedTo)
  1255. }
  1256. }
  1257. {
  1258. const prefix string = ",\"is_relay\":"
  1259. out.RawString(prefix)
  1260. out.Bool(bool(in.IsRelay))
  1261. }
  1262. {
  1263. const prefix string = ",\"relayed_conf\":"
  1264. out.RawString(prefix)
  1265. if in.RelayedPeerConf == nil && (out.Flags&jwriter.NilMapAsEmpty) == 0 {
  1266. out.RawString(`null`)
  1267. } else {
  1268. out.RawByte('{')
  1269. v44First := true
  1270. for v44Name, v44Value := range in.RelayedPeerConf {
  1271. if v44First {
  1272. v44First = false
  1273. } else {
  1274. out.RawByte(',')
  1275. }
  1276. out.String(string(v44Name))
  1277. out.RawByte(':')
  1278. easyjsonDa059d96EncodeGithubComGravitlNetmakerModels13(out, v44Value)
  1279. }
  1280. out.RawByte('}')
  1281. }
  1282. }
  1283. out.RawByte('}')
  1284. }
  1285. func easyjsonDa059d96DecodeGithubComGravitlNetmakerModels13(in *jlexer.Lexer, out *RelayedConf) {
  1286. isTopLevel := in.IsStart()
  1287. if in.IsNull() {
  1288. if isTopLevel {
  1289. in.Consumed()
  1290. }
  1291. in.Skip()
  1292. return
  1293. }
  1294. in.Delim('{')
  1295. for !in.IsDelim('}') {
  1296. key := in.UnsafeFieldName(false)
  1297. in.WantColon()
  1298. if in.IsNull() {
  1299. in.Skip()
  1300. in.WantComma()
  1301. continue
  1302. }
  1303. switch key {
  1304. case "relayed_peer_endpoint":
  1305. if in.IsNull() {
  1306. in.Skip()
  1307. out.RelayedPeerEndpoint = nil
  1308. } else {
  1309. if out.RelayedPeerEndpoint == nil {
  1310. out.RelayedPeerEndpoint = new(net.UDPAddr)
  1311. }
  1312. easyjsonDa059d96DecodeNet1(in, out.RelayedPeerEndpoint)
  1313. }
  1314. case "relayed_peer_pub_key":
  1315. out.RelayedPeerPubKey = string(in.String())
  1316. case "relayed_peers":
  1317. if in.IsNull() {
  1318. in.Skip()
  1319. out.Peers = nil
  1320. } else {
  1321. in.Delim('[')
  1322. if out.Peers == nil {
  1323. if !in.IsDelim(']') {
  1324. out.Peers = make([]wgtypes.PeerConfig, 0, 0)
  1325. } else {
  1326. out.Peers = []wgtypes.PeerConfig{}
  1327. }
  1328. } else {
  1329. out.Peers = (out.Peers)[:0]
  1330. }
  1331. for !in.IsDelim(']') {
  1332. var v45 wgtypes.PeerConfig
  1333. easyjsonDa059d96DecodeGolangZx2c4ComWireguardWgctrlWgtypes(in, &v45)
  1334. out.Peers = append(out.Peers, v45)
  1335. in.WantComma()
  1336. }
  1337. in.Delim(']')
  1338. }
  1339. default:
  1340. in.SkipRecursive()
  1341. }
  1342. in.WantComma()
  1343. }
  1344. in.Delim('}')
  1345. if isTopLevel {
  1346. in.Consumed()
  1347. }
  1348. }
  1349. func easyjsonDa059d96EncodeGithubComGravitlNetmakerModels13(out *jwriter.Writer, in RelayedConf) {
  1350. out.RawByte('{')
  1351. first := true
  1352. _ = first
  1353. {
  1354. const prefix string = ",\"relayed_peer_endpoint\":"
  1355. out.RawString(prefix[1:])
  1356. if in.RelayedPeerEndpoint == nil {
  1357. out.RawString("null")
  1358. } else {
  1359. easyjsonDa059d96EncodeNet1(out, *in.RelayedPeerEndpoint)
  1360. }
  1361. }
  1362. {
  1363. const prefix string = ",\"relayed_peer_pub_key\":"
  1364. out.RawString(prefix)
  1365. out.String(string(in.RelayedPeerPubKey))
  1366. }
  1367. {
  1368. const prefix string = ",\"relayed_peers\":"
  1369. out.RawString(prefix)
  1370. if in.Peers == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
  1371. out.RawString("null")
  1372. } else {
  1373. out.RawByte('[')
  1374. for v46, v47 := range in.Peers {
  1375. if v46 > 0 {
  1376. out.RawByte(',')
  1377. }
  1378. easyjsonDa059d96EncodeGolangZx2c4ComWireguardWgctrlWgtypes(out, v47)
  1379. }
  1380. out.RawByte(']')
  1381. }
  1382. }
  1383. out.RawByte('}')
  1384. }
  1385. func easyjsonDa059d96DecodeNet1(in *jlexer.Lexer, out *net.UDPAddr) {
  1386. isTopLevel := in.IsStart()
  1387. if in.IsNull() {
  1388. if isTopLevel {
  1389. in.Consumed()
  1390. }
  1391. in.Skip()
  1392. return
  1393. }
  1394. in.Delim('{')
  1395. for !in.IsDelim('}') {
  1396. key := in.UnsafeFieldName(false)
  1397. in.WantColon()
  1398. if in.IsNull() {
  1399. in.Skip()
  1400. in.WantComma()
  1401. continue
  1402. }
  1403. switch key {
  1404. case "IP":
  1405. if data := in.UnsafeBytes(); in.Ok() {
  1406. in.AddError((out.IP).UnmarshalText(data))
  1407. }
  1408. case "Port":
  1409. out.Port = int(in.Int())
  1410. case "Zone":
  1411. out.Zone = string(in.String())
  1412. default:
  1413. in.SkipRecursive()
  1414. }
  1415. in.WantComma()
  1416. }
  1417. in.Delim('}')
  1418. if isTopLevel {
  1419. in.Consumed()
  1420. }
  1421. }
  1422. func easyjsonDa059d96EncodeNet1(out *jwriter.Writer, in net.UDPAddr) {
  1423. out.RawByte('{')
  1424. first := true
  1425. _ = first
  1426. {
  1427. const prefix string = ",\"IP\":"
  1428. out.RawString(prefix[1:])
  1429. out.RawText((in.IP).MarshalText())
  1430. }
  1431. {
  1432. const prefix string = ",\"Port\":"
  1433. out.RawString(prefix)
  1434. out.Int(int(in.Port))
  1435. }
  1436. {
  1437. const prefix string = ",\"Zone\":"
  1438. out.RawString(prefix)
  1439. out.String(string(in.Zone))
  1440. }
  1441. out.RawByte('}')
  1442. }
  1443. func easyjsonDa059d96DecodeGithubComGravitlNetmakerModels12(in *jlexer.Lexer, out *PeerConf) {
  1444. isTopLevel := in.IsStart()
  1445. if in.IsNull() {
  1446. if isTopLevel {
  1447. in.Consumed()
  1448. }
  1449. in.Skip()
  1450. return
  1451. }
  1452. in.Delim('{')
  1453. for !in.IsDelim('}') {
  1454. key := in.UnsafeFieldName(false)
  1455. in.WantColon()
  1456. if in.IsNull() {
  1457. in.Skip()
  1458. in.WantComma()
  1459. continue
  1460. }
  1461. switch key {
  1462. case "proxy":
  1463. out.Proxy = bool(in.Bool())
  1464. case "public_listen_port":
  1465. out.PublicListenPort = int32(in.Int32())
  1466. case "proxy_listen_port":
  1467. out.ProxyListenPort = int(in.Int())
  1468. case "is_ext_client":
  1469. out.IsExtClient = bool(in.Bool())
  1470. case "address":
  1471. if data := in.UnsafeBytes(); in.Ok() {
  1472. in.AddError((out.Address).UnmarshalText(data))
  1473. }
  1474. case "is_relayed":
  1475. out.IsRelayed = bool(in.Bool())
  1476. case "relayed_to":
  1477. if in.IsNull() {
  1478. in.Skip()
  1479. out.RelayedTo = nil
  1480. } else {
  1481. if out.RelayedTo == nil {
  1482. out.RelayedTo = new(net.UDPAddr)
  1483. }
  1484. easyjsonDa059d96DecodeNet1(in, out.RelayedTo)
  1485. }
  1486. case "nat_type":
  1487. out.NatType = string(in.String())
  1488. default:
  1489. in.SkipRecursive()
  1490. }
  1491. in.WantComma()
  1492. }
  1493. in.Delim('}')
  1494. if isTopLevel {
  1495. in.Consumed()
  1496. }
  1497. }
  1498. func easyjsonDa059d96EncodeGithubComGravitlNetmakerModels12(out *jwriter.Writer, in PeerConf) {
  1499. out.RawByte('{')
  1500. first := true
  1501. _ = first
  1502. {
  1503. const prefix string = ",\"proxy\":"
  1504. out.RawString(prefix[1:])
  1505. out.Bool(bool(in.Proxy))
  1506. }
  1507. {
  1508. const prefix string = ",\"public_listen_port\":"
  1509. out.RawString(prefix)
  1510. out.Int32(int32(in.PublicListenPort))
  1511. }
  1512. {
  1513. const prefix string = ",\"proxy_listen_port\":"
  1514. out.RawString(prefix)
  1515. out.Int(int(in.ProxyListenPort))
  1516. }
  1517. {
  1518. const prefix string = ",\"is_ext_client\":"
  1519. out.RawString(prefix)
  1520. out.Bool(bool(in.IsExtClient))
  1521. }
  1522. {
  1523. const prefix string = ",\"address\":"
  1524. out.RawString(prefix)
  1525. out.RawText((in.Address).MarshalText())
  1526. }
  1527. {
  1528. const prefix string = ",\"is_relayed\":"
  1529. out.RawString(prefix)
  1530. out.Bool(bool(in.IsRelayed))
  1531. }
  1532. {
  1533. const prefix string = ",\"relayed_to\":"
  1534. out.RawString(prefix)
  1535. if in.RelayedTo == nil {
  1536. out.RawString("null")
  1537. } else {
  1538. easyjsonDa059d96EncodeNet1(out, *in.RelayedTo)
  1539. }
  1540. }
  1541. {
  1542. const prefix string = ",\"nat_type\":"
  1543. out.RawString(prefix)
  1544. out.String(string(in.NatType))
  1545. }
  1546. out.RawByte('}')
  1547. }
  1548. func easyjsonDa059d96DecodeGithubComGravitlNetmakerModels3(in *jlexer.Lexer, out *IDandAddr) {
  1549. isTopLevel := in.IsStart()
  1550. if in.IsNull() {
  1551. if isTopLevel {
  1552. in.Consumed()
  1553. }
  1554. in.Skip()
  1555. return
  1556. }
  1557. in.Delim('{')
  1558. for !in.IsDelim('}') {
  1559. key := in.UnsafeFieldName(false)
  1560. in.WantColon()
  1561. if in.IsNull() {
  1562. in.Skip()
  1563. in.WantComma()
  1564. continue
  1565. }
  1566. switch key {
  1567. case "id":
  1568. out.ID = string(in.String())
  1569. case "address":
  1570. out.Address = string(in.String())
  1571. case "name":
  1572. out.Name = string(in.String())
  1573. case "isserver":
  1574. out.IsServer = string(in.String())
  1575. case "network":
  1576. out.Network = string(in.String())
  1577. case "proxy_listen_port":
  1578. out.ProxyListenPort = int(in.Int())
  1579. default:
  1580. in.SkipRecursive()
  1581. }
  1582. in.WantComma()
  1583. }
  1584. in.Delim('}')
  1585. if isTopLevel {
  1586. in.Consumed()
  1587. }
  1588. }
  1589. func easyjsonDa059d96EncodeGithubComGravitlNetmakerModels3(out *jwriter.Writer, in IDandAddr) {
  1590. out.RawByte('{')
  1591. first := true
  1592. _ = first
  1593. {
  1594. const prefix string = ",\"id\":"
  1595. out.RawString(prefix[1:])
  1596. out.String(string(in.ID))
  1597. }
  1598. {
  1599. const prefix string = ",\"address\":"
  1600. out.RawString(prefix)
  1601. out.String(string(in.Address))
  1602. }
  1603. {
  1604. const prefix string = ",\"name\":"
  1605. out.RawString(prefix)
  1606. out.String(string(in.Name))
  1607. }
  1608. {
  1609. const prefix string = ",\"isserver\":"
  1610. out.RawString(prefix)
  1611. out.String(string(in.IsServer))
  1612. }
  1613. {
  1614. const prefix string = ",\"network\":"
  1615. out.RawString(prefix)
  1616. out.String(string(in.Network))
  1617. }
  1618. {
  1619. const prefix string = ",\"proxy_listen_port\":"
  1620. out.RawString(prefix)
  1621. out.Int(int(in.ProxyListenPort))
  1622. }
  1623. out.RawByte('}')
  1624. }
  1625. func easyjsonDa059d96DecodeGolangZx2c4ComWireguardWgctrlWgtypes(in *jlexer.Lexer, out *wgtypes.PeerConfig) {
  1626. isTopLevel := in.IsStart()
  1627. if in.IsNull() {
  1628. if isTopLevel {
  1629. in.Consumed()
  1630. }
  1631. in.Skip()
  1632. return
  1633. }
  1634. in.Delim('{')
  1635. for !in.IsDelim('}') {
  1636. key := in.UnsafeFieldName(false)
  1637. in.WantColon()
  1638. if in.IsNull() {
  1639. in.Skip()
  1640. in.WantComma()
  1641. continue
  1642. }
  1643. switch key {
  1644. case "PublicKey":
  1645. if in.IsNull() {
  1646. in.Skip()
  1647. } else {
  1648. copy(out.PublicKey[:], in.Bytes())
  1649. }
  1650. case "Remove":
  1651. out.Remove = bool(in.Bool())
  1652. case "UpdateOnly":
  1653. out.UpdateOnly = bool(in.Bool())
  1654. case "PresharedKey":
  1655. if in.IsNull() {
  1656. in.Skip()
  1657. out.PresharedKey = nil
  1658. } else {
  1659. if out.PresharedKey == nil {
  1660. out.PresharedKey = new(wgtypes.Key)
  1661. }
  1662. if in.IsNull() {
  1663. in.Skip()
  1664. } else {
  1665. copy(out.PresharedKey[:], in.Bytes())
  1666. }
  1667. }
  1668. case "Endpoint":
  1669. if in.IsNull() {
  1670. in.Skip()
  1671. out.Endpoint = nil
  1672. } else {
  1673. if out.Endpoint == nil {
  1674. out.Endpoint = new(net.UDPAddr)
  1675. }
  1676. easyjsonDa059d96DecodeNet1(in, out.Endpoint)
  1677. }
  1678. case "PersistentKeepaliveInterval":
  1679. if in.IsNull() {
  1680. in.Skip()
  1681. out.PersistentKeepaliveInterval = nil
  1682. } else {
  1683. if out.PersistentKeepaliveInterval == nil {
  1684. out.PersistentKeepaliveInterval = new(time.Duration)
  1685. }
  1686. *out.PersistentKeepaliveInterval = time.Duration(in.Int64())
  1687. }
  1688. case "ReplaceAllowedIPs":
  1689. out.ReplaceAllowedIPs = bool(in.Bool())
  1690. case "AllowedIPs":
  1691. if in.IsNull() {
  1692. in.Skip()
  1693. out.AllowedIPs = nil
  1694. } else {
  1695. in.Delim('[')
  1696. if out.AllowedIPs == nil {
  1697. if !in.IsDelim(']') {
  1698. out.AllowedIPs = make([]net.IPNet, 0, 1)
  1699. } else {
  1700. out.AllowedIPs = []net.IPNet{}
  1701. }
  1702. } else {
  1703. out.AllowedIPs = (out.AllowedIPs)[:0]
  1704. }
  1705. for !in.IsDelim(']') {
  1706. var v50 net.IPNet
  1707. easyjsonDa059d96DecodeNet(in, &v50)
  1708. out.AllowedIPs = append(out.AllowedIPs, v50)
  1709. in.WantComma()
  1710. }
  1711. in.Delim(']')
  1712. }
  1713. default:
  1714. in.SkipRecursive()
  1715. }
  1716. in.WantComma()
  1717. }
  1718. in.Delim('}')
  1719. if isTopLevel {
  1720. in.Consumed()
  1721. }
  1722. }
  1723. func easyjsonDa059d96EncodeGolangZx2c4ComWireguardWgctrlWgtypes(out *jwriter.Writer, in wgtypes.PeerConfig) {
  1724. out.RawByte('{')
  1725. first := true
  1726. _ = first
  1727. {
  1728. const prefix string = ",\"PublicKey\":"
  1729. out.RawString(prefix[1:])
  1730. out.Base64Bytes(in.PublicKey[:])
  1731. }
  1732. {
  1733. const prefix string = ",\"Remove\":"
  1734. out.RawString(prefix)
  1735. out.Bool(bool(in.Remove))
  1736. }
  1737. {
  1738. const prefix string = ",\"UpdateOnly\":"
  1739. out.RawString(prefix)
  1740. out.Bool(bool(in.UpdateOnly))
  1741. }
  1742. {
  1743. const prefix string = ",\"PresharedKey\":"
  1744. out.RawString(prefix)
  1745. if in.PresharedKey == nil {
  1746. out.RawString("null")
  1747. } else {
  1748. out.Base64Bytes(in.PresharedKey[:])
  1749. }
  1750. }
  1751. {
  1752. const prefix string = ",\"Endpoint\":"
  1753. out.RawString(prefix)
  1754. if in.Endpoint == nil {
  1755. out.RawString("null")
  1756. } else {
  1757. easyjsonDa059d96EncodeNet1(out, *in.Endpoint)
  1758. }
  1759. }
  1760. {
  1761. const prefix string = ",\"PersistentKeepaliveInterval\":"
  1762. out.RawString(prefix)
  1763. if in.PersistentKeepaliveInterval == nil {
  1764. out.RawString("null")
  1765. } else {
  1766. out.Int64(int64(*in.PersistentKeepaliveInterval))
  1767. }
  1768. }
  1769. {
  1770. const prefix string = ",\"ReplaceAllowedIPs\":"
  1771. out.RawString(prefix)
  1772. out.Bool(bool(in.ReplaceAllowedIPs))
  1773. }
  1774. {
  1775. const prefix string = ",\"AllowedIPs\":"
  1776. out.RawString(prefix)
  1777. if in.AllowedIPs == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
  1778. out.RawString("null")
  1779. } else {
  1780. out.RawByte('[')
  1781. for v53, v54 := range in.AllowedIPs {
  1782. if v53 > 0 {
  1783. out.RawByte(',')
  1784. }
  1785. easyjsonDa059d96EncodeNet(out, v54)
  1786. }
  1787. out.RawByte(']')
  1788. }
  1789. }
  1790. out.RawByte('}')
  1791. }
  1792. func easyjsonDa059d96DecodeGithubComGravitlNetmakerModels2(in *jlexer.Lexer, out *ServerAddr) {
  1793. isTopLevel := in.IsStart()
  1794. if in.IsNull() {
  1795. if isTopLevel {
  1796. in.Consumed()
  1797. }
  1798. in.Skip()
  1799. return
  1800. }
  1801. in.Delim('{')
  1802. for !in.IsDelim('}') {
  1803. key := in.UnsafeFieldName(false)
  1804. in.WantColon()
  1805. if in.IsNull() {
  1806. in.Skip()
  1807. in.WantComma()
  1808. continue
  1809. }
  1810. switch key {
  1811. case "isleader":
  1812. out.IsLeader = bool(in.Bool())
  1813. case "address":
  1814. out.Address = string(in.String())
  1815. default:
  1816. in.SkipRecursive()
  1817. }
  1818. in.WantComma()
  1819. }
  1820. in.Delim('}')
  1821. if isTopLevel {
  1822. in.Consumed()
  1823. }
  1824. }
  1825. func easyjsonDa059d96EncodeGithubComGravitlNetmakerModels2(out *jwriter.Writer, in ServerAddr) {
  1826. out.RawByte('{')
  1827. first := true
  1828. _ = first
  1829. {
  1830. const prefix string = ",\"isleader\":"
  1831. out.RawString(prefix[1:])
  1832. out.Bool(bool(in.IsLeader))
  1833. }
  1834. {
  1835. const prefix string = ",\"address\":"
  1836. out.RawString(prefix)
  1837. out.String(string(in.Address))
  1838. }
  1839. out.RawByte('}')
  1840. }
  1841. func easyjsonDa059d96DecodeGithubComGravitlNetmakerModels1(in *jlexer.Lexer, out *Host) {
  1842. isTopLevel := in.IsStart()
  1843. if in.IsNull() {
  1844. if isTopLevel {
  1845. in.Consumed()
  1846. }
  1847. in.Skip()
  1848. return
  1849. }
  1850. in.Delim('{')
  1851. for !in.IsDelim('}') {
  1852. key := in.UnsafeFieldName(false)
  1853. in.WantColon()
  1854. if in.IsNull() {
  1855. in.Skip()
  1856. in.WantComma()
  1857. continue
  1858. }
  1859. switch key {
  1860. case "id":
  1861. if data := in.UnsafeBytes(); in.Ok() {
  1862. in.AddError((out.ID).UnmarshalText(data))
  1863. }
  1864. case "verbosity":
  1865. out.Verbosity = int(in.Int())
  1866. case "firewallinuse":
  1867. out.FirewallInUse = string(in.String())
  1868. case "version":
  1869. out.Version = string(in.String())
  1870. case "ipforwarding":
  1871. out.IPForwarding = bool(in.Bool())
  1872. case "daemoninstalled":
  1873. out.DaemonInstalled = bool(in.Bool())
  1874. case "autoupdate":
  1875. out.AutoUpdate = bool(in.Bool())
  1876. case "endpointdetection":
  1877. out.EndpointDetection = bool(in.Bool())
  1878. case "hostpass":
  1879. out.HostPass = string(in.String())
  1880. case "name":
  1881. out.Name = string(in.String())
  1882. case "os":
  1883. out.OS = string(in.String())
  1884. case "interface":
  1885. out.Interface = string(in.String())
  1886. case "debug":
  1887. out.Debug = bool(in.Bool())
  1888. case "listenport":
  1889. out.ListenPort = int(in.Int())
  1890. case "public_listen_port":
  1891. out.PublicListenPort = int(in.Int())
  1892. case "wg_public_listen_port":
  1893. out.WgPublicListenPort = int(in.Int())
  1894. case "proxy_listen_port":
  1895. out.ProxyListenPort = int(in.Int())
  1896. case "mtu":
  1897. out.MTU = int(in.Int())
  1898. case "publickey":
  1899. if in.IsNull() {
  1900. in.Skip()
  1901. } else {
  1902. copy(out.PublicKey[:], in.Bytes())
  1903. }
  1904. case "macaddress":
  1905. if in.IsNull() {
  1906. in.Skip()
  1907. out.MacAddress = nil
  1908. } else {
  1909. out.MacAddress = in.Bytes()
  1910. }
  1911. case "traffickeypublic":
  1912. if in.IsNull() {
  1913. in.Skip()
  1914. out.TrafficKeyPublic = nil
  1915. } else {
  1916. out.TrafficKeyPublic = in.Bytes()
  1917. }
  1918. case "internetgateway":
  1919. easyjsonDa059d96DecodeNet1(in, &out.InternetGateway)
  1920. case "nodes":
  1921. if in.IsNull() {
  1922. in.Skip()
  1923. out.Nodes = nil
  1924. } else {
  1925. in.Delim('[')
  1926. if out.Nodes == nil {
  1927. if !in.IsDelim(']') {
  1928. out.Nodes = make([]string, 0, 4)
  1929. } else {
  1930. out.Nodes = []string{}
  1931. }
  1932. } else {
  1933. out.Nodes = (out.Nodes)[:0]
  1934. }
  1935. for !in.IsDelim(']') {
  1936. var v58 string
  1937. v58 = string(in.String())
  1938. out.Nodes = append(out.Nodes, v58)
  1939. in.WantComma()
  1940. }
  1941. in.Delim(']')
  1942. }
  1943. case "isrelayed":
  1944. out.IsRelayed = bool(in.Bool())
  1945. case "relayed_by":
  1946. out.RelayedBy = string(in.String())
  1947. case "isrelay":
  1948. out.IsRelay = bool(in.Bool())
  1949. case "relay_hosts":
  1950. if in.IsNull() {
  1951. in.Skip()
  1952. out.RelayedHosts = nil
  1953. } else {
  1954. in.Delim('[')
  1955. if out.RelayedHosts == nil {
  1956. if !in.IsDelim(']') {
  1957. out.RelayedHosts = make([]string, 0, 4)
  1958. } else {
  1959. out.RelayedHosts = []string{}
  1960. }
  1961. } else {
  1962. out.RelayedHosts = (out.RelayedHosts)[:0]
  1963. }
  1964. for !in.IsDelim(']') {
  1965. var v59 string
  1966. v59 = string(in.String())
  1967. out.RelayedHosts = append(out.RelayedHosts, v59)
  1968. in.WantComma()
  1969. }
  1970. in.Delim(']')
  1971. }
  1972. case "interfaces":
  1973. if in.IsNull() {
  1974. in.Skip()
  1975. out.Interfaces = nil
  1976. } else {
  1977. in.Delim('[')
  1978. if out.Interfaces == nil {
  1979. if !in.IsDelim(']') {
  1980. out.Interfaces = make([]Iface, 0, 0)
  1981. } else {
  1982. out.Interfaces = []Iface{}
  1983. }
  1984. } else {
  1985. out.Interfaces = (out.Interfaces)[:0]
  1986. }
  1987. for !in.IsDelim(']') {
  1988. var v60 Iface
  1989. easyjsonDa059d96DecodeGithubComGravitlNetmakerModels8(in, &v60)
  1990. out.Interfaces = append(out.Interfaces, v60)
  1991. in.WantComma()
  1992. }
  1993. in.Delim(']')
  1994. }
  1995. case "defaultinterface":
  1996. out.DefaultInterface = string(in.String())
  1997. case "endpointip":
  1998. if data := in.UnsafeBytes(); in.Ok() {
  1999. in.AddError((out.EndpointIP).UnmarshalText(data))
  2000. }
  2001. case "proxy_enabled":
  2002. out.ProxyEnabled = bool(in.Bool())
  2003. case "proxy_enabled_updated":
  2004. out.ProxyEnabledSet = bool(in.Bool())
  2005. case "isdocker":
  2006. out.IsDocker = bool(in.Bool())
  2007. case "isk8s":
  2008. out.IsK8S = bool(in.Bool())
  2009. case "isstatic":
  2010. out.IsStatic = bool(in.Bool())
  2011. case "isdefault":
  2012. out.IsDefault = bool(in.Bool())
  2013. case "nat_type":
  2014. out.NatType = string(in.String())
  2015. case "turn_endpoint":
  2016. if in.IsNull() {
  2017. in.Skip()
  2018. out.TurnEndpoint = nil
  2019. } else {
  2020. if out.TurnEndpoint == nil {
  2021. out.TurnEndpoint = new(netip.AddrPort)
  2022. }
  2023. if data := in.UnsafeBytes(); in.Ok() {
  2024. in.AddError((*out.TurnEndpoint).UnmarshalText(data))
  2025. }
  2026. }
  2027. default:
  2028. in.SkipRecursive()
  2029. }
  2030. in.WantComma()
  2031. }
  2032. in.Delim('}')
  2033. if isTopLevel {
  2034. in.Consumed()
  2035. }
  2036. }
  2037. func easyjsonDa059d96EncodeGithubComGravitlNetmakerModels1(out *jwriter.Writer, in Host) {
  2038. out.RawByte('{')
  2039. first := true
  2040. _ = first
  2041. {
  2042. const prefix string = ",\"id\":"
  2043. out.RawString(prefix[1:])
  2044. out.RawText((in.ID).MarshalText())
  2045. }
  2046. {
  2047. const prefix string = ",\"verbosity\":"
  2048. out.RawString(prefix)
  2049. out.Int(int(in.Verbosity))
  2050. }
  2051. {
  2052. const prefix string = ",\"firewallinuse\":"
  2053. out.RawString(prefix)
  2054. out.String(string(in.FirewallInUse))
  2055. }
  2056. {
  2057. const prefix string = ",\"version\":"
  2058. out.RawString(prefix)
  2059. out.String(string(in.Version))
  2060. }
  2061. {
  2062. const prefix string = ",\"ipforwarding\":"
  2063. out.RawString(prefix)
  2064. out.Bool(bool(in.IPForwarding))
  2065. }
  2066. {
  2067. const prefix string = ",\"daemoninstalled\":"
  2068. out.RawString(prefix)
  2069. out.Bool(bool(in.DaemonInstalled))
  2070. }
  2071. {
  2072. const prefix string = ",\"autoupdate\":"
  2073. out.RawString(prefix)
  2074. out.Bool(bool(in.AutoUpdate))
  2075. }
  2076. {
  2077. const prefix string = ",\"endpointdetection\":"
  2078. out.RawString(prefix)
  2079. out.Bool(bool(in.EndpointDetection))
  2080. }
  2081. {
  2082. const prefix string = ",\"hostpass\":"
  2083. out.RawString(prefix)
  2084. out.String(string(in.HostPass))
  2085. }
  2086. {
  2087. const prefix string = ",\"name\":"
  2088. out.RawString(prefix)
  2089. out.String(string(in.Name))
  2090. }
  2091. {
  2092. const prefix string = ",\"os\":"
  2093. out.RawString(prefix)
  2094. out.String(string(in.OS))
  2095. }
  2096. {
  2097. const prefix string = ",\"interface\":"
  2098. out.RawString(prefix)
  2099. out.String(string(in.Interface))
  2100. }
  2101. {
  2102. const prefix string = ",\"debug\":"
  2103. out.RawString(prefix)
  2104. out.Bool(bool(in.Debug))
  2105. }
  2106. {
  2107. const prefix string = ",\"listenport\":"
  2108. out.RawString(prefix)
  2109. out.Int(int(in.ListenPort))
  2110. }
  2111. {
  2112. const prefix string = ",\"public_listen_port\":"
  2113. out.RawString(prefix)
  2114. out.Int(int(in.PublicListenPort))
  2115. }
  2116. {
  2117. const prefix string = ",\"wg_public_listen_port\":"
  2118. out.RawString(prefix)
  2119. out.Int(int(in.WgPublicListenPort))
  2120. }
  2121. {
  2122. const prefix string = ",\"proxy_listen_port\":"
  2123. out.RawString(prefix)
  2124. out.Int(int(in.ProxyListenPort))
  2125. }
  2126. {
  2127. const prefix string = ",\"mtu\":"
  2128. out.RawString(prefix)
  2129. out.Int(int(in.MTU))
  2130. }
  2131. {
  2132. const prefix string = ",\"publickey\":"
  2133. out.RawString(prefix)
  2134. out.Base64Bytes(in.PublicKey[:])
  2135. }
  2136. {
  2137. const prefix string = ",\"macaddress\":"
  2138. out.RawString(prefix)
  2139. out.Base64Bytes(in.MacAddress)
  2140. }
  2141. {
  2142. const prefix string = ",\"traffickeypublic\":"
  2143. out.RawString(prefix)
  2144. out.Base64Bytes(in.TrafficKeyPublic)
  2145. }
  2146. {
  2147. const prefix string = ",\"internetgateway\":"
  2148. out.RawString(prefix)
  2149. easyjsonDa059d96EncodeNet1(out, in.InternetGateway)
  2150. }
  2151. {
  2152. const prefix string = ",\"nodes\":"
  2153. out.RawString(prefix)
  2154. if in.Nodes == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
  2155. out.RawString("null")
  2156. } else {
  2157. out.RawByte('[')
  2158. for v66, v67 := range in.Nodes {
  2159. if v66 > 0 {
  2160. out.RawByte(',')
  2161. }
  2162. out.String(string(v67))
  2163. }
  2164. out.RawByte(']')
  2165. }
  2166. }
  2167. {
  2168. const prefix string = ",\"isrelayed\":"
  2169. out.RawString(prefix)
  2170. out.Bool(bool(in.IsRelayed))
  2171. }
  2172. {
  2173. const prefix string = ",\"relayed_by\":"
  2174. out.RawString(prefix)
  2175. out.String(string(in.RelayedBy))
  2176. }
  2177. {
  2178. const prefix string = ",\"isrelay\":"
  2179. out.RawString(prefix)
  2180. out.Bool(bool(in.IsRelay))
  2181. }
  2182. {
  2183. const prefix string = ",\"relay_hosts\":"
  2184. out.RawString(prefix)
  2185. if in.RelayedHosts == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
  2186. out.RawString("null")
  2187. } else {
  2188. out.RawByte('[')
  2189. for v68, v69 := range in.RelayedHosts {
  2190. if v68 > 0 {
  2191. out.RawByte(',')
  2192. }
  2193. out.String(string(v69))
  2194. }
  2195. out.RawByte(']')
  2196. }
  2197. }
  2198. {
  2199. const prefix string = ",\"interfaces\":"
  2200. out.RawString(prefix)
  2201. if in.Interfaces == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
  2202. out.RawString("null")
  2203. } else {
  2204. out.RawByte('[')
  2205. for v70, v71 := range in.Interfaces {
  2206. if v70 > 0 {
  2207. out.RawByte(',')
  2208. }
  2209. easyjsonDa059d96EncodeGithubComGravitlNetmakerModels8(out, v71)
  2210. }
  2211. out.RawByte(']')
  2212. }
  2213. }
  2214. {
  2215. const prefix string = ",\"defaultinterface\":"
  2216. out.RawString(prefix)
  2217. out.String(string(in.DefaultInterface))
  2218. }
  2219. {
  2220. const prefix string = ",\"endpointip\":"
  2221. out.RawString(prefix)
  2222. out.RawText((in.EndpointIP).MarshalText())
  2223. }
  2224. {
  2225. const prefix string = ",\"proxy_enabled\":"
  2226. out.RawString(prefix)
  2227. out.Bool(bool(in.ProxyEnabled))
  2228. }
  2229. {
  2230. const prefix string = ",\"proxy_enabled_updated\":"
  2231. out.RawString(prefix)
  2232. out.Bool(bool(in.ProxyEnabledSet))
  2233. }
  2234. {
  2235. const prefix string = ",\"isdocker\":"
  2236. out.RawString(prefix)
  2237. out.Bool(bool(in.IsDocker))
  2238. }
  2239. {
  2240. const prefix string = ",\"isk8s\":"
  2241. out.RawString(prefix)
  2242. out.Bool(bool(in.IsK8S))
  2243. }
  2244. {
  2245. const prefix string = ",\"isstatic\":"
  2246. out.RawString(prefix)
  2247. out.Bool(bool(in.IsStatic))
  2248. }
  2249. {
  2250. const prefix string = ",\"isdefault\":"
  2251. out.RawString(prefix)
  2252. out.Bool(bool(in.IsDefault))
  2253. }
  2254. if in.NatType != "" {
  2255. const prefix string = ",\"nat_type\":"
  2256. out.RawString(prefix)
  2257. out.String(string(in.NatType))
  2258. }
  2259. if in.TurnEndpoint != nil {
  2260. const prefix string = ",\"turn_endpoint\":"
  2261. out.RawString(prefix)
  2262. out.RawText((*in.TurnEndpoint).MarshalText())
  2263. }
  2264. out.RawByte('}')
  2265. }