ARP¶
-
class
ryu.lib.packet.arp.
arp
(hwtype=1, proto=2048, hlen=6, plen=4, opcode=1, src_mac='ff:ff:ff:ff:ff:ff', src_ip='0.0.0.0', dst_mac='ff:ff:ff:ff:ff:ff', dst_ip='0.0.0.0')¶ ARP (RFC 826) header encoder/decoder class.
An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. IPv4 addresses are represented as a string like '192.0.2.1'. MAC addresses are represented as a string like '08:60:6e:7f:74:e7'. __init__ takes the corresponding args in this order.
Attribute Description Example hwtype Hardware address. proto Protocol address. hlen byte length of each hardware address. plen byte length of each protocol address. opcode operation codes. src_mac Hardware address of sender. '08:60:6e:7f:74:e7' src_ip Protocol address of sender. '192.0.2.1' dst_mac Hardware address of target. '00:00:00:00:00:00' dst_ip Protocol address of target. '192.0.2.2'
-
ryu.lib.packet.arp.
arp_ip
(opcode, src_mac, src_ip, dst_mac, dst_ip)¶ A convenient wrapper for IPv4 ARP for Ethernet.
This is an equivalent of the following code.
arp(ARP_HW_TYPE_ETHERNET, ether.ETH_TYPE_IP, 6, 4, opcode, src_mac, src_ip, dst_mac, dst_ip)