ofp_event: add a function to find Event class for given OFP class
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
parent
a4a77546d8
commit
5f57cfd16a
@ -40,8 +40,12 @@ def _ofp_msg_name_to_ev_name(msg_name):
|
|||||||
|
|
||||||
|
|
||||||
def ofp_msg_to_ev(msg):
|
def ofp_msg_to_ev(msg):
|
||||||
name = _ofp_msg_name_to_ev_name(msg.__class__.__name__)
|
return ofp_msg_to_ev_cls(msg.__class__)(msg)
|
||||||
return _OFP_MSG_EVENTS[name](msg)
|
|
||||||
|
|
||||||
|
def ofp_msg_to_ev_cls(msg_cls):
|
||||||
|
name = _ofp_msg_name_to_ev_name(msg_cls.__name__)
|
||||||
|
return _OFP_MSG_EVENTS[name]
|
||||||
|
|
||||||
|
|
||||||
def _create_ofp_msg_ev_class(msg_cls):
|
def _create_ofp_msg_ev_class(msg_cls):
|
||||||
|
Loading…
Reference in New Issue
Block a user