This is automatically generated documentation. Edit after the "COMMENTS" heading; changes to the main body will be lost.

AddressInfo Element Documentation

NAME

AddressInfo -- Click element; specifies address information

SYNOPSIS

AddressInfo(NAME ADDRESS [ADDRESS...], ...)

Ports: None
Package: standard (core)

DESCRIPTION

Lets you use mnemonic names for IPv4 and IPv6 addresses, IPv4 and IPv6 address prefixes, and Ethernet addresses. Each argument has the form `NAME ADDRESS [ADDRESS...]', which associates the given ADDRESSes with NAME. For example, if a configuration contains this AddressInfo element,

   AddressInfo(mauer 10.0.0.1, mazu 10.0.0.10);

then other configuration strings can use mauer and mazu as mnemonics for the IP addresses 10.0.0.1 and 10.0.0.10, respectively. The mnemonic names introduced by AddressInfo elements are local with respect to compound elements. That is, names created inside a compound element apply only within that compound element and its subelements. For example:

   AddressInfo(mauer 10.0.0.1);
   compound :: {
     AddressInfo(mazu 10.0.0.10);
     ... -> IPEncap(6, mauer, mazu) -> ...  // OK
   };
   ... -> IPEncap(6, mauer, mazu) -> ...    // error: `mazu' undefined

Any name can be simultaneously associated with an IP address, an IP network address, and an Ethernet address. The kind of address that is returned is generally determined from context. For example:

   AddressInfo(mauer 10.0.0.1 00-50-BA-85-84-A9);
   ... -> IPEncap(6, mauer, ...)                  // as IP address
       -> EtherEncap(0x0800, mauer, ...) -> ...   // as Ethernet address
   ... -> ARPResponder(mauer) -> ...              // as IP address and Ethernet address!

An optional suffix makes the context unambiguous. NAME is an ambiguous reference to some address, but NAME:ip is always an IPv4 address, NAME:ipnet is always an IPv4 network address (IPv4 address prefix), NAME:ip6 is always an IPv6 address, NAME:ip6net is always an IPv6 network address, and NAME:eth is always an Ethernet address. Names with both address and prefix definitions are preferentially parsed as addresses. For example:

   AddressInfo(boojum 10.0.0.1/24);         // defines address and prefix
   a1 :: ARPResponder(boojum 00-01-02-03-04-05);
   // a1 will have the same configuration as:
   a2 :: ARPResponder(10.0.0.1/32 00-01-02-03-04-05);

To prefer the network prefix, use NAME:ipnet. If NAME:ipnet is a valid IPv4 network address, then NAME:bcast is a valid IPv4 address equaling the broadcast address for that network. This is obtained by setting all the host bits in the address prefix to 1. If NAME:ipnet is a valid IPv4 network address, then NAME:gw is a valid IPv4 address equaling the default gateway address for that network. This is obtained by setting all the host bits in the address prefix to 0, except for the lowest order bit.

DEFAULT ADDRESSES

If you do not define an address for a given name, AddressInfo will use the default, if any. Defaults are as follows:

*
If DEVNAME is the name of an Ethernet device, then DEVNAME:eth defaults to DEVNAME's Ethernet address. (At userlevel, this works only on BSD and Linux.)
*
DEVNAME:ip defaults to the first primary IPv4 address associated with the device DEVNAME. These defaults are not available on all platforms.

SEE ALSO

PortInfo

Generated by 'click-elem2man' from '../include/click/standard/addressinfo.hh:11' on 12/Jul/2011.

COMMENTS

 
elements/addressinfo.txt · Last modified: 2011/07/12 11:29 (external edit)
 
Recent changes RSS feed Driven by DokuWiki