[Xorp-hackers] Interface configuration under xorp.

Kristian larsson kristian@juniks.net
Wed, 25 May 2005 20:07:04 +0200


Quoting Pavlin Radoslavov <pavlin@icir.org>:

> > > The "create" command is intentional. The way configuration is
> > > handled (inside xorpsh and the rtrmgr) is that you start with an
> > > empty configuration tree, and then new nodes are added to that
> > > tree. The "create" command is the one used to add new nodes to the
> > > configuration tree. For example, "create protocols rip" creates a
> > > RIP instance, while "create protocols rip interface eth0"
> > > will create a new interface instance inside the RIP instance.
> > >
> > > Extending the command completion for the "create" command to
> > > provide, say, only the names of existing interfaces in the kernel
> > > may be possible, but practically speaking it won't be easy and the
> > > gain may be too small. For example, such enhancement may be in
> > > conflict with being able to create and configure new VLAN interfaces
> > > within xorpsh.
> > I see and I somewhat agree, it's understandable that one would need to
> "create"
> > the interface within xorps configuration tree since just as you've said
> it's
> > difficult to implement cli completion of interface names. What I still
> don't
> > understand is why there is a create commmand. It would be easier (at least
> from
> > the user perspective) to merge the create and set commands.
> > If a configuration node (such as interfaces interface fxp0) doesn't exist
> it
> > should be created when running the command: set interfaces interface fxp0
> vif
> > fxp0 address 10.0.0.1 prefix-length 24;
>
> I see. Yes, we can merge the create and set commands. The original
> reason why we have two separate commands is because each command has
> clear semantics: "create" is used to create/add new nodes, while
> "set" is used to modify existing nodes.
> I will discuss your suggestion with other folks.
>From a developer point of view it's quite clear why there are two commands.
I beleive it would greatly improve workflow by joining these into one.
>
> > And I still would like to see some more cli completion, when having
> written:
> > create interfaces interface fxp0 vif fxp0 <address>
> > I think it should be possible to help me out with "address" right?
> > or even "vif" at:
> > create interfeaces interface fxp0 <vif>
>
> If you are creating/adding a new address or a vif to an interface,
> how xorpsh can assist you with the command line completion?
> The xorpsh doesn't know what vif name or an address value you want
> to choose; furthermore, it cannot narrow those to just few choices
> (note that in case of UNIX the vif name has to be same as the
> interface name, but in general they don't have to be the same).
I'm sorry I got it a bit wrong. It shouldn't help filling in "vif" it should
just give the option when pressing <?>.
if I write:
create interfaces interface fxp0 <? - press question mark>
xorp should respond with a small list:
Possible completions:
vif    create virtual interface

right now, the list is empty.

Regards,
Kristian