Re: [LARTC] A complicated routing scenario (for me at least)

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 15 Nov 2000, Wingtung.Leung wrote:

> 
> On Tue, 14 Nov 2000, Andrew wrote:
> 
> > OK.. someplace else to look. Are the examples the only thing available
> > in the way of file syntax? Also could someone help me understand how
> > these files are read at startup if they exist. (what code/script is
> > responsible for doing it, and what happens if there are syntax errors. I
> > have a redhat 6.2 system.)
> 
> Maybe you should try it first and experiment a bit. It's rather hard to
> answer on vague questions.

But not impossible. There is the iproute2 code that does the actual
parsing of the files in /etc/iproute2, and there is some information in the
ip-cref doc. The parser is the function rtnl_tab_initialize in
lib/rt_names.c of the iproute2 source tree. The syntax is one of the
following for scanf formats (read the manpage for scanf if you can't parse
these by sight):

0x%x %s\n
0x%x %s #
%d %s\n
%d %s #

Implied is basically a key-value table, with decimal or hexadecimal numbers
as keys and strings as values. Comments are allowed and whitespace is mostly
ignored. There has to be some between keys and values though. :)

If there are syntax errors you will only see numbers instead of nice user
friendly names, after the ip or tc tool has complained about 'Database <xyz>
is corrupted at <foobar>', with one of the files instead of <xyz> and part
of the file instead of <foobar>

Doei, Arthur.

-- 
  /\    / |      arthurvl@xxxxxxxxxx      | Work like you don't need the money
 /__\  /  | A friend is someone with whom | Love like you have never been hurt
/    \/__ | you can dare to be yourself   | Dance like there's nobody watching




[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux