node.proto 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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 CheckIn(CheckInReq) returns (CheckInRes);
  12. }
  13. message LoginRequest {
  14. string macaddress = 1;
  15. string password = 2;
  16. string network = 3;
  17. }
  18. message LoginResponse { string accesstoken = 1; }
  19. message Node {
  20. string id = 1;
  21. string name = 2;
  22. string address = 3;
  23. string address6 = 26;
  24. int32 listenport = 4;
  25. string publickey = 5;
  26. string endpoint = 6;
  27. string macaddress = 7;
  28. string password = 8;
  29. string nodenetwork = 9;
  30. bool ispending = 10;
  31. string postup = 11;
  32. string postdown = 12;
  33. int32 keepalive = 13;
  34. bool saveconfig = 14;
  35. string accesskey = 15;
  36. string interface = 16;
  37. string lastcheckin = 17;
  38. string lastmodified = 18;
  39. int32 checkininterval = 19;
  40. string localaddress = 20;
  41. string postchanges = 21;
  42. string allowedips = 22;
  43. bool islocal = 23;
  44. bool isdualstack = 27;
  45. bool dnsoff = 24;
  46. string localrange = 25;
  47. }
  48. message CheckInResponse {
  49. bool success = 1;
  50. bool needpeerupdate = 2;
  51. bool needconfigupdate = 3;
  52. string nodemessage = 4;
  53. bool ispending = 5;
  54. bool needkeyupdate = 6;
  55. bool needdelete = 7;
  56. }
  57. message PeersResponse {
  58. bool isgateway = 1;
  59. string gatewayrange = 2;
  60. string publickey = 5;
  61. string endpoint = 6;
  62. string address = 3;
  63. string address6 = 8;
  64. int32 listenport = 4;
  65. string localaddress = 7;
  66. int32 keepalive = 13;
  67. }
  68. message CreateNodeReq {
  69. Node node = 1; // Node id blank
  70. }
  71. message CreateNodeRes {
  72. Node node = 1; // Node id filled in
  73. }
  74. message UpdateNodeReq {
  75. Node node = 1;
  76. }
  77. message UpdateNodeRes {
  78. Node node = 1;
  79. }
  80. message ReadNodeReq {
  81. string macaddress = 1;
  82. string network = 2;
  83. }
  84. message ReadNodeRes {
  85. Node node = 1;
  86. }
  87. message DeleteNodeReq {
  88. string macaddress = 1;
  89. string networkName = 2;
  90. }
  91. message DeleteNodeRes {
  92. bool success = 1;
  93. }
  94. message GetPeersReq {
  95. string macaddress = 1;
  96. string network = 2;
  97. }
  98. message GetPeersRes {
  99. PeersResponse peers = 1;
  100. }
  101. message CheckInReq {
  102. Node node = 1;
  103. // bool postchanges = 2;
  104. }
  105. message CheckInRes {
  106. CheckInResponse checkinresponse = 1;
  107. }