blob: 29b59f4b5fdbfb03c469e50119a29e7ff98ab0f5 [file] [log] [blame]
Dan Talaycof75360a2010-02-05 22:22:54 -08001import socket
2
3class ofsocket:
4 """OpenFlow scoket
5 """
6 def __init__(self, socket):
7 """Initialize with socket
8 """
9 ##Reference to socket
10 self.socket = socket
11
12 def send(self, msg):
13 """Send message
14 """
15 ofph = ofp_header()
16 remaining = ofph.unpack(msg)
17 if (ofph.length != len(msg)):
18 ofph.length = len(msg)
19 msg = ofph.pack()+remaining
20 self.socket.send(msg)
21