blob: 29b59f4b5fdbfb03c469e50119a29e7ff98ab0f5 [file] [log] [blame]
import socket
class ofsocket:
"""OpenFlow scoket
"""
def __init__(self, socket):
"""Initialize with socket
"""
##Reference to socket
self.socket = socket
def send(self, msg):
"""Send message
"""
ofph = ofp_header()
remaining = ofph.unpack(msg)
if (ofph.length != len(msg)):
ofph.length = len(msg)
msg = ofph.pack()+remaining
self.socket.send(msg)