blob: dfab26392048ffe7361a1c0c67ce8b0b3204dcd2 [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.
Dan Talaycof6202252013-07-02 01:00:29 -07004# See the file LICENSE.pyloxi which should have been included in the source distribution
Rich Laneb658ddd2013-03-12 10:15:10 -07005
6# Automatically generated by LOXI from template toplevel_init.py
7# Do not modify
8
Rich Lanec2ee4b82013-04-24 17:12:38 -07009version_names = {1: '1.0', 2: '1.1', 3: '1.2', 4: '1.3'}
10
Rich Laneb658ddd2013-03-12 10:15:10 -070011def protocol(ver):
12 """
13 Import and return the protocol module for the given wire version.
14 """
15 if ver == 1:
16 import of10
17 return of10
Rich Lanec2ee4b82013-04-24 17:12:38 -070018 elif ver == 2:
19 import of11
20 return of11
21 elif ver == 3:
22 import of12
23 return of12
24 elif ver == 4:
25 import of13
26 return of13
Rich Laneb658ddd2013-03-12 10:15:10 -070027 else:
28 raise ValueError
29
30class ProtocolError(Exception):
31 """
32 Raised when failing to deserialize an invalid OpenFlow message.
33 """
34 pass
Rich Lanec2ee4b82013-04-24 17:12:38 -070035
36class Unimplemented(Exception):
37 """
38 Raised when an OpenFlow feature is not yet implemented in PyLoxi.
39 """
40 pass
41
42def unimplemented(msg):
43 raise Unimplemented(msg)