Hello to all.
Using the OFPMatch class, I'm having some difficulty in applying a
mask to the ipv4_dst field.
The following code shows how I'm doing it.
client_ipv4 is an ipaddress.IPv4Address instance.
ipv4_network is an ipaddress.IPv4Network instance.
match=ofp_parser.OFPMatch(
in_port=pkt_in_port, eth_src=pkt.src, eth_type=ether.ETH_TYPE_IP,
ipv4_src=str(client_ipv4), ipv4_dst=(str(ipv4_network),
str(ipv4_network.netmask)),
ip_proto=inet.IPPROTO_TCP
),
Using this code, raises the following exception.
Traceback (most recent call last):
File
"/home/carlosmf/PythonVirtEnv/SDN_Controller/lib/python3.6/site-packages/archsdn/ArchSDN.py",
line 219, in packet_in_event
engine.process_packet_in_event(ev)
File
"/home/carlosmf/PythonVirtEnv/SDN_Controller/lib/python3.6/site-packages/archsdn/engine/kernel.py",
line 1192, in process_packet_in_event
ip_proto=inet.IPPROTO_UDP
File
"/home/carlosmf/PythonVirtEnv/SDN_Controller/lib/python3.6/site-packages/ryu/ofproto/ofproto_v1_3_parser.py",
line 891, in __init__
(k, v) in kwargs.items())
File
"/home/carlosmf/PythonVirtEnv/SDN_Controller/lib/python3.6/site-packages/ryu/ofproto/ofproto_v1_3_parser.py",
line 891, in <genexpr>
(k, v) in kwargs.items())
File
"/home/carlosmf/PythonVirtEnv/SDN_Controller/lib/python3.6/site-packages/ryu/ofproto/oxx_fields.py",
line 133, in _normalize_user
v = b''.join(six.int2byte(_ord(x) & _ord(y)) for (x, y) in zip(v, m))
File
"/home/carlosmf/PythonVirtEnv/SDN_Controller/lib/python3.6/site-packages/ryu/ofproto/oxx_fields.py",
line 133, in <genexpr>
v = b''.join(six.int2byte(_ord(x) & _ord(y)) for (x, y) in zip(v, m))
ValueError: invalid literal for int() with base 10: b'\n\x00\x00\x00'
Can anyone tell me if I'm improperly using the ipv4_dst field ?
Thank you.
--
Carlos Miguel Ferreira
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel