blob: 58fa3d778477dc3fbaeb1ef1f9e7fd269fdf9983 [file] [log] [blame]
Rich Lanec2ee4b82013-04-24 17:12:38 -07001# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
2# Copyright (c) 2011, 2012 Open Networking Foundation
3# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
Rich Laneb658ddd2013-03-12 10:15:10 -07004
5# Automatically generated by LOXI from template toplevel_init.py
6# Do not modify
7
Rich Lanec2ee4b82013-04-24 17:12:38 -07008version_names = {1: '1.0', 2: '1.1', 3: '1.2', 4: '1.3'}
9
Rich Laneb658ddd2013-03-12 10:15:10 -070010def protocol(ver):
11 """
12 Import and return the protocol module for the given wire version.
13 """
14 if ver == 1:
15 import of10
16 return of10
Rich Lanec2ee4b82013-04-24 17:12:38 -070017 elif ver == 2:
18 import of11
19 return of11
20 elif ver == 3:
21 import of12
22 return of12
23 elif ver == 4:
24 import of13
25 return of13
Rich Laneb658ddd2013-03-12 10:15:10 -070026 else:
27 raise ValueError
28
29class ProtocolError(Exception):
30 """
31 Raised when failing to deserialize an invalid OpenFlow message.
32 """
33 pass
Rich Lanec2ee4b82013-04-24 17:12:38 -070034
35class Unimplemented(Exception):
36 """
37 Raised when an OpenFlow feature is not yet implemented in PyLoxi.
38 """
39 pass
40
41def unimplemented(msg):
42 raise Unimplemented(msg)