Struct nfqueue::Message [] [src]

pub struct Message { /* fields omitted */ }

Opaque struct Message: abstracts NFLOG data representing a packet data and metadata

Methods

impl Message
[src]

Returns the unique ID of the packet

Get the packet mark

Get the packet timestamp

Get the interface that the packet was received through

Returns the index of the device the packet was received via. If the returned index is 0, the packet was locally generated or the input interface is not known (ie. POSTROUTING?).

Get the physical interface that the packet was received through

Returns the index of the physical device the packet was received via. If the returned index is 0, the packet was locally generated or the physical input interface is no longer known (ie. POSTROUTING?).

Get the interface that the packet will be routed out

Returns the index of the device the packet will be sent out. If the returned index is 0, the packet is destined to localhost or the output interface is not yet known (ie. PREROUTING?).

Get the physical interface that the packet will be routed out

Returns the index of the physical device the packet will be sent out. If the returned index is 0, the packet is destined to localhost or the physical output interface is not yet known (ie. PREROUTING?).

Get hardware address

Retrieves the hardware address associated with the given packet.

For ethernet packets, the hardware address returned (if any) will be the MAC address of the packet source host.

The destination MAC address is not known until after POSTROUTING and a successful ARP request, so cannot currently be retrieved.

Issue a verdict on a packet

Notifies netfilter of the userspace verdict for the given packet.

Every queued packet must have a verdict specified by userspace, either by calling this function, or by calling any other set_verdict_* function.

Arguments

  • verdict: verdict to return to netfilter (Verdict::Accept, Verdict::Drop, ...)

Issue a verdict on a packet, with a mark

Notifies netfilter of the userspace verdict for the given packet.

Every queued packet must have a verdict specified by userspace, either by calling this function, or by calling any other set_verdict_* function.

Arguments

  • verdict: verdict to return to netfilter (Verdict::Accept, Verdict::Drop, ...)
  • mark: the mark to put on the packet, in network-byte order

Issue a verdict on a packet, with a mark and new data

Notifies netfilter of the userspace verdict for the given packet. The new packet will replace the one that was queued.

Every queued packet must have a verdict specified by userspace, either by calling this function, or by calling any other set_verdict_* function.

Arguments

  • verdict: verdict to return to netfilter (Verdict::Accept, Verdict::Drop, ...)
  • mark: the mark to put on the packet, in network-byte order
  • data: the new packet

Get payload

Depending on set_mode, we may not have a payload. The actual amount and type of data retrieved by this function will depend on the mode set with the set_mode() function.

Print the queued packet in XML format into a buffer

Trait Implementations

impl Display for Message
[src]

Formats the value using the given formatter. Read more