public final class ArpPacketBuilder extends Object
ArpPacketBuilder is a utility to build an ARP packet.| Constructor and Description |
|---|
ArpPacketBuilder()
Construct a new instance that builds an ARP request to be sent to
the untagged network.
|
ArpPacketBuilder(int vid)
Construct a new instance that builds an ARP request to be sent to the
specified VLAN.
|
ArpPacketBuilder(int vid,
short op)
Construct a new instance that builds an ARP packet.
|
| Modifier and Type | Method and Description |
|---|---|
Ethernet |
build(EtherAddress src,
EtherAddress dst,
InetAddress addr)
Create an Ethernet frame which contains an ARP request message to
probe the given IP address.
|
Ethernet |
build(EtherAddress src,
EtherAddress dst,
Ip4Network target)
Create an Ethernet frame which contains an ARP message.
|
Ethernet |
build(EtherAddress src,
InetAddress addr)
Create a broadcast Ethernet frame which contains an ARP request message
to probe the given IP address.
|
ArpPacketBuilder |
setSenderProtocolAddress(Ip4Network ip4)
Set the sender protocol address.
|
public ArpPacketBuilder()
public ArpPacketBuilder(int vid)
vid - The VLAN ID that specifies the VLAN.
EtherHeader.VLAN_NONE indicates the untagged
network.public ArpPacketBuilder(int vid,
short op)
vid - The VLAN ID that specifies the VLAN.
EtherHeader.VLAN_NONE indicates the untagged
network.op - ARP operation code.public ArpPacketBuilder setSenderProtocolAddress(Ip4Network ip4)
ip4 - An Ip4Network instance which indicates the
sender protocol address. Note that the prefix length is
always ignored.public Ethernet build(EtherAddress src, InetAddress addr)
src - An EtherAddress instance to be used as the source
MAC address.addr - The target IP address.null is returned if addr
is invalid.public Ethernet build(EtherAddress src, EtherAddress dst, InetAddress addr)
src - An EtherAddress instance to be used as the source
MAC address.dst - The destination MAC address.addr - The target IP address.null is returned if addr
is invalid.public Ethernet build(EtherAddress src, EtherAddress dst, Ip4Network target)
src - Source MAC address.dst - Destination MAC address.target - Target IP address.Copyright © 2018 OpenDaylight. All rights reserved.