summaryrefslogtreecommitdiffhomepage
path: root/setup.py
diff options
context:
space:
mode:
authorYuichi Ito <ito.yuichi0@gmail.com>2013-12-12 15:32:17 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2013-12-12 18:21:50 +0900
commit8cee77dad16cb93787e48eda5bafc26d2530d132 (patch)
tree0c5eaaa72d5600038444a22609ac6fe17b8fcf3a /setup.py
parent1c6bc8ae5754afa499103bb12f500a346d4a0613 (diff)
packet lib: dhcp: fix reversibility about json
although DHCP is using internal classes, no class is registered into '_class_prefixes'. therefore, from_jsondict() does not work correctly. this patch makes from_jsondict() to work correctly by registering internal classes into '_class_prefixes'. examination code: from ryu.lib.packet import dhcp msg1 = dhcp.dhcp(op=dhcp.DHCP_BOOT_REQUEST, chaddr='00:00:00:00:00:00', options=dhcp.options()) print msg1 jsondict = msg1.to_jsondict() msg2 = dhcp.dhcp.from_jsondict(jsondict['dhcp']) print msg2 print str(msg1) == str(msg2) before applying this patch: dhcp(boot_file='',chaddr='00:00:00:00:00:00',ciaddr='0.0.0.0',flags=0,giaddr='0.0.0.0',hlen=17,hops=0,htype=1,op=1,options=options(magic_cookie='99.130.83.99',option_list=[],options_len=0),secs=0,siaddr='0.0.0.0',sname='',xid=2430470794,yiaddr='0.0.0.0') dhcp(boot_file='',chaddr='00:00:00:00:00:00',ciaddr='0.0.0.0',flags=0,giaddr='0.0.0.0',hlen=17,hops=0,htype=1,op=1,options={'options': {'option_list': [], 'magic_cookie': '99.130.83.99', 'options_len': 0}},secs=0,siaddr='0.0.0.0',sname='',xid=2430470794,yiaddr='0.0.0.0') False after applying this patch: dhcp(boot_file='',chaddr='00:00:00:00:00:00',ciaddr='0.0.0.0',flags=0,giaddr='0.0.0.0',hlen=17,hops=0,htype=1,op=1,options=options(magic_cookie='99.130.83.99',option_list=[],options_len=0),secs=0,siaddr='0.0.0.0',sname='',xid=1161619526,yiaddr='0.0.0.0') dhcp(boot_file='',chaddr='00:00:00:00:00:00',ciaddr='0.0.0.0',flags=0,giaddr='0.0.0.0',hlen=17,hops=0,htype=1,op=1,options=options(magic_cookie='99.130.83.99',option_list=[],options_len=0),secs=0,siaddr='0.0.0.0',sname='',xid=1161619526,yiaddr='0.0.0.0') True Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'setup.py')
0 files changed, 0 insertions, 0 deletions