[netcf-devel] dumpxml output format of resulting xml file

Laine Stump laine at laine.org
Tue Feb 28 02:08:51 UTC 2012


On 02/27/2012 07:50 PM, hiren panchasara wrote:
> Hi All,
>
> I am looking inside /test/interface/ at ethernet-dhcp.xml and
> ethernet-static.xml:
>
> [1]ethernet-dhcp.xml
> <interface type="ethernet" name="eth0">
>
>   <start mode="none"/>
>   <mac address="aa:bb:cc:dd:ee:ff"/>
>   <mtu size="1492"/>
>
>   <protocol family="ipv4">
>     <dhcp/><!-- peerdns="no"/>-->
>   </protocol>
>
> </interface>
> [2]ethernet-static.xml
> <interface type="ethernet" name="eth1">
>   <start mode="onboot"/>
>   <protocol family="ipv4">
>
>     <ip address="192.168.0.5" prefix="24"/>
>
>     <route gateway="192.168.0.1"/>
>   </protocol>
> </interface>
>
> What I understand is, when "dumpxml em0" is called, if em0 is an
> ethernet interface whose address has been provided by dhcp, the o/p
> *must* look like [1] and if address is statically allocated, o/p
> *must* look like [2]. Please correct me if that is not accurate.

These files are examples, not exhaustive grammars. A complete grammar is
in data/xml/interface.rng. (all of the examples combined should do a
reasonable job of exercising all the possible elements, although *not*
in all possible combinations).

To answer your specific question, though - the when the interface uses
dhcp to get it's IP address, the <ip>
element would look something like what you have in item [1] (although
you can specify some options to <dhcp, as is hinted at by the
commented-out "perrdns='no'" attribute), and when it is configured
manually, the <ip> element would look something like what's in item [2];
the other elements are exampls that work equally well no matter what is
in the <ip> element (i.e. whether or not you would want to specify a MAC
address is independent of what the <ip> element looks like).

>
>  I want to understand rationale behind this format. How are these
> decided. For example,  why "mac address" and "mtu size" do not matter
> in [2]?

That is not the case. You could just as easily specify mtu and mac
address when you configure the ip address manually.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://fedorahosted.org/pipermail/netcf-devel/attachments/20120227/fd7670bd/attachment.html>


More information about the netcf-devel mailing list