forked from sipcapture/heplify-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhep.proto
69 lines (62 loc) · 2.8 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
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.0/protoc-3.6.0-linux-x86_64.zip
unzip protoc-3.6.0-linux-x86_64.zip -d protoc3
sudo mv protoc3/bin/* /usr/local/bin/
sudo mv protoc3/include/* /usr/local/include/
#
protoc -I=. -I=$GOPATH/src -I=$GOPATH/src/github.com/gogo/protobuf/protobuf --gogoslick_out=. hep.proto
#
// HEP represents HEP packet
type HEP struct {
Version uint32 `protobuf:"varint,1,req,name=Version" json:"Version"`
Protocol uint32 `protobuf:"varint,2,req,name=Protocol" json:"Protocol"`
SrcIP string `protobuf:"bytes,3,req,name=SrcIP" json:"SrcIP"`
DstIP string `protobuf:"bytes,4,req,name=DstIP" json:"DstIP"`
SrcPort uint32 `protobuf:"varint,5,req,name=SrcPort" json:"SrcPort"`
DstPort uint32 `protobuf:"varint,6,req,name=DstPort" json:"DstPort"`
Tsec uint32 `protobuf:"varint,7,req,name=Tsec" json:"Tsec"`
Tmsec uint32 `protobuf:"varint,8,req,name=Tmsec" json:"Tmsec"`
ProtoType uint32 `protobuf:"varint,9,req,name=ProtoType" json:"ProtoType"`
NodeID uint32 `protobuf:"varint,10,req,name=NodeID" json:"NodeID"`
NodePW string `protobuf:"bytes,11,req,name=NodePW" json:"NodePW"`
Payload string `protobuf:"bytes,12,req,name=Payload" json:"Payload"`
CID string `protobuf:"bytes,13,req,name=CID" json:"CID"`
Vlan uint32 `protobuf:"varint,14,req,name=Vlan" json:"Vlan"`
NetSrcIP net.IP
NetDstIP net.IP
Timestamp time.Time
SIP *sipparser.SipMsg
}
*/