initial commit
This commit is contained in:
10
protobuf/compile.sh
Executable file
10
protobuf/compile.sh
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
cd "$(dirname "$(readlink -f "$0")")"
|
||||
|
||||
rm -rf ../src/capport/comm/protobuf/message_pb2.py
|
||||
mkdir -p ../src/capport/comm/protobuf
|
||||
|
||||
protoc --python_out=../src/capport/comm/protobuf message.proto
|
42
protobuf/message.proto
Normal file
42
protobuf/message.proto
Normal file
@ -0,0 +1,42 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package capport;
|
||||
|
||||
message Message {
|
||||
oneof oneof {
|
||||
Hello hello = 1;
|
||||
AuthenticationResult authentication_result = 2;
|
||||
Ping ping = 3;
|
||||
MacStates mac_states = 10;
|
||||
}
|
||||
}
|
||||
|
||||
// sent by clients and servers as first message
|
||||
message Hello {
|
||||
bytes instance_id = 1;
|
||||
string hostname = 2;
|
||||
bool is_controller = 3;
|
||||
bytes authentication = 4;
|
||||
}
|
||||
|
||||
// tell peer whether hello authentication was good
|
||||
message AuthenticationResult {
|
||||
bool success = 1;
|
||||
}
|
||||
|
||||
message Ping {
|
||||
bytes payload = 1;
|
||||
}
|
||||
|
||||
message MacStates {
|
||||
repeated MacState states = 1;
|
||||
}
|
||||
|
||||
message MacState {
|
||||
bytes mac_address = 1;
|
||||
// Seconds of UTC time since epoch
|
||||
int64 last_change = 2;
|
||||
// Seconds of UTC time since epoch
|
||||
int64 allow_until = 3;
|
||||
bool allowed = 4;
|
||||
}
|
Reference in New Issue
Block a user