node.proto 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. syntax = "proto3";
  2. package node;
  3. option go_package = "google.golang.org/protobuf/types/known/nodepb";
  4. service NodeService {
  5. rpc Login(LoginRequest) returns (LoginResponse);
  6. rpc CreateNode(CreateNodeReq) returns (CreateNodeRes);
  7. rpc ReadNode(ReadNodeReq) returns (ReadNodeRes);
  8. rpc UpdateNode(UpdateNodeReq) returns (UpdateNodeRes);
  9. rpc DeleteNode(DeleteNodeReq) returns (DeleteNodeRes);
  10. rpc GetPeers(GetPeersReq) returns (stream GetPeersRes);
  11. rpc GetExtPeers(GetExtPeersReq) returns (stream GetExtPeersRes);
  12. rpc CheckIn(CheckInReq) returns (CheckInRes);
  13. }
  14. message LoginRequest {
  15. string macaddress = 1;
  16. string password = 2;
  17. string network = 3;
  18. }
  19. message LoginResponse { string accesstoken = 1; }
  20. message Node {
  21. string id = 1;
  22. string name = 2;
  23. string address = 3;
  24. string address6 = 26;
  25. int32 listenport = 4;
  26. string publickey = 5;
  27. string endpoint = 6;
  28. string macaddress = 7;
  29. string password = 8;
  30. string nodenetwork = 9;
  31. bool ispending = 10;
  32. string postup = 11;
  33. string postdown = 12;
  34. int32 keepalive = 13;
  35. bool saveconfig = 14;
  36. string accesskey = 15;
  37. string interface = 16;
  38. string lastcheckin = 17;
  39. string lastmodified = 18;
  40. int32 checkininterval = 19;
  41. string localaddress = 20;
  42. string postchanges = 21;
  43. string allowedips = 22;
  44. bool islocal = 23;
  45. bool isingressgateway = 28;
  46. bool isdualstack = 27;
  47. bool dnsoff = 24;
  48. string localrange = 25;
  49. }
  50. message CheckInResponse {
  51. bool success = 1;
  52. bool needpeerupdate = 2;
  53. bool needconfigupdate = 3;
  54. string nodemessage = 4;
  55. bool ispending = 5;
  56. bool needkeyupdate = 6;
  57. bool needdelete = 7;
  58. }
  59. message PeersResponse {
  60. bool isegressgateway = 1;
  61. string egressgatewayrange = 2;
  62. string publickey = 5;
  63. string endpoint = 6;
  64. string address = 3;
  65. string address6 = 8;
  66. int32 listenport = 4;
  67. string localaddress = 7;
  68. int32 keepalive = 13;
  69. }
  70. message ExtPeersResponse {
  71. string publickey = 5;
  72. string endpoint = 6;
  73. string address = 3;
  74. string address6 = 8;
  75. int32 listenport = 4;
  76. string localaddress = 7;
  77. int32 keepalive = 13;
  78. }
  79. message CreateNodeReq {
  80. Node node = 1; // Node id blank
  81. }
  82. message CreateNodeRes {
  83. Node node = 1; // Node id filled in
  84. }
  85. message UpdateNodeReq {
  86. Node node = 1;
  87. }
  88. message UpdateNodeRes {
  89. Node node = 1;
  90. }
  91. message ReadNodeReq {
  92. string macaddress = 1;
  93. string network = 2;
  94. }
  95. message ReadNodeRes {
  96. Node node = 1;
  97. }
  98. message DeleteNodeReq {
  99. string macaddress = 1;
  100. string networkName = 2;
  101. }
  102. message DeleteNodeRes {
  103. bool success = 1;
  104. }
  105. message GetPeersReq {
  106. string macaddress = 1;
  107. string network = 2;
  108. }
  109. message GetExtPeersReq {
  110. string macaddress = 1;
  111. string network = 2;
  112. }
  113. message GetPeersRes {
  114. PeersResponse peers = 1;
  115. }
  116. message GetExtPeersRes {
  117. ExtPeersResponse extpeers = 1;
  118. }
  119. message CheckInReq {
  120. Node node = 1;
  121. // bool postchanges = 2;
  122. }
  123. message CheckInRes {
  124. CheckInResponse checkinresponse = 1;
  125. }