blob: 827dd8525d1a9a22f0a218911e05d4669cafe2e4 [file] [log] [blame]
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -08001#
2# Interface definition for packetstreamer service
3#
4
5namespace java net.floodlightcontroller.packetstreamer.thrift
6namespace cpp net.floodlightcontroller.packetstreamer
7namespace py packetstreamer
8namespace php packetstreamer
9namespace perl packetstreamer
10
11const string VERSION = "0.1.0"
12
13#
14# data structures
15#
16
17/**
18 * OFMessage type
19 **/
20enum OFMessageType {
21 HELLO = 0,
22 ERROR = 1,
23 ECHO_REQUEST = 2,
24 ECHO_REPLY = 3,
25 VENDOR = 4,
26 FEATURES_REQUEST = 5,
27 FEATURES_REPLY = 6,
28 GET_CONFIG_REQUEST = 7,
29 GET_CONFIG_REPLY = 8,
30 SET_CONFIG = 9,
31 PACKET_IN = 10,
32 FLOW_REMOVED = 11,
33 PORT_STATUS = 12,
34 PACKET_OUT = 13,
35 FLOW_MOD = 14,
36 PORT_MOD = 15,
37 STATS_REQUEST = 16,
38 STATS_REPLY = 17,
39 BARRIER_REQUEST = 18,
40 BARRIER_REPLY = 19,
41}
42
43/**
44 * A struct that defines switch port tuple
45 */
46struct SwitchPortTuple {
47 1: i64 dpid,
48 2: i16 port,
49}
50
51struct Packet {
52 1: OFMessageType messageType,
53 2: SwitchPortTuple swPortTuple,
54 3: binary data,
55}
56
57struct Message {
58 1: list<string> sessionIDs,
59 2: Packet packet,
60}
61
62/**
63 * Packetstreamer API
64 */
65service PacketStreamer {
66
67 /**
68 * Synchronous method to get packets for a given sessionid
69 */
70 list<binary> getPackets(1:string sessionid),
71
72 /**
73 * Synchronous method to publish a packet.
74 * It ensure the order that the packets are pushed
75 */
76 i32 pushMessageSync(1:Message packet),
77
78 /**
79 * Asynchronous method to publish a packet.
80 * Order is not guaranteed.
81 */
82 oneway void pushMessageAsync(1:Message packet)
83
84 /**
85 * Terminate a session
86 */
87 void terminateSession(1:string sessionid)
88}