-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
#サンプルコードは以下の通りです。
def handle_arp_request( datapath_id, message )
@arp_table.learn message.arp_spa.to_s, message.arp_sha.to_s, message.in_port.to_i
daddr = message.arp_tpa
interface = @interface.find_by_ipaddr( daddr )
if interface.class.name != "SQLite3::Statement" and @interface.has?( message.eth_dst )
puts "send a arp reply to #{ message.arp_spa.to_s }"
packet_out datapath_id, create_arp_reply_from( message, interface["hwaddr"] ), Actions::SendOutPort.new( port_number: interface["port"] )
end
end
def packet_out datapath_id, message, action
send_packet_out(
p message
datapath_id,
data: message,
actions: action
)
end
#messageの内容は以下の通りです。
p message => "d1PT\x01\x14\0\x90\xFB-\xDCi\b\x06\0\x01\b\0\x06\x04\0\x02\0\x90\xFB-\xDCi\xC0\xA8\0\xFEd1PT\x01\x14\xC0\xA8\0\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
#出力されるエラーは以下の通りです。
An Ethernet frame must be provided if buffer_id is equal to 0xffffffff