-
-
Notifications
You must be signed in to change notification settings - Fork 94
/
Copy pathhep.proto
47 lines (39 loc) · 1.93 KB
/
hep.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
syntax = "proto2";
package decoder;
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
option (gogoproto.gostring_all) = true;
option (gogoproto.goproto_stringer_all) = false;
option (gogoproto.stringer_all) = true;
option (gogoproto.marshaler_all) = true;
option (gogoproto.sizer_all) = true;
option (gogoproto.unmarshaler_all) = true;
// For tests
//option (gogoproto.testgen_all) = true;
option (gogoproto.benchgen_all) = true;
option (gogoproto.equal_all) = true;
option (gogoproto.populate_all) = true;
// HEP represents HEP packet
message HEP {
required uint32 Version = 1 [(gogoproto.nullable) = false];
required uint32 Protocol = 2 [(gogoproto.nullable) = false];
required string SrcIP = 3 [(gogoproto.nullable) = false];
required string DstIP = 4 [(gogoproto.nullable) = false];
required uint32 SrcPort = 5 [(gogoproto.nullable) = false];
required uint32 DstPort = 6 [(gogoproto.nullable) = false];
required uint32 Tsec = 7 [(gogoproto.nullable) = false];
required uint32 Tmsec = 8 [(gogoproto.nullable) = false];
required uint32 ProtoType = 9 [(gogoproto.nullable) = false];
required uint32 NodeID = 10 [(gogoproto.nullable) = false];
required string NodePW = 11 [(gogoproto.nullable) = false];
required string Payload = 12 [(gogoproto.nullable) = false];
required string CID = 13 [(gogoproto.nullable) = false];
required uint32 Vlan = 14 [(gogoproto.nullable) = false];
}
// curl -OL https://github.com/google/protobuf/releases/download/v3.6.1/protoc-3.6.1-linux-x86_64.zip
// unzip protoc-3.6.1-linux-x86_64.zip -d protoc3
// sudo mv protoc3/bin/* /usr/local/bin/
// sudo mv protoc3/include/* /usr/local/include/
// go get github.com/gogo/protobuf/protoc-gen-gogoslick
// go get github.com/gogo/protobuf/protoc-gen-gogofaster
// protoc -I=. -I=$GOPATH/src -I=$GOPATH/src/github.com/gogo/protobuf/protobuf --gogoslick_out=. hep.proto
// protoc -I=. -I=$GOPATH/src -I=$GOPATH/src/github.com/gogo/protobuf/protobuf --gogofaster_out=. hep.proto