default tcp host

Thiago Macieira thiago at
Fri Jun 15 10:51:05 PDT 2007

Havoc Pennington wrote:
> you can specify an interface to
>advertise on by "AvahiIfIndex" (I can't find in the Avahi docs what this
>index is or how to pick it).

It's the interface index, the same one reported by /sbin/ip:

$ /sbin/ip link
1: lo: <LOOPBACK,UP,10000> mtu 16436 qdisc noqueue
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 
    link/ether 00:c0:9f:db:2a:0f brd ff:ff:ff:ff:ff:ff
3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast 
qlen 1000
    link/ether 00:13:ce:96:93:d2 brd ff:ff:ff:ff:ff:ff
4: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000
    link/ieee1394 00:c0:9f:00:00:6c:ef:24 brd ff:ff:ff:ff:ff:ff:ff:ff
5: irda0: <NOARP,UP,10000> mtu 2048 qdisc pfifo_fast qlen 8
    link/irda 11:79:32:cf brd ff:ff:ff:ff
6: sit0: <NOARP> mtu 1480 qdisc noop
    link/sit brd
8: tap0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 100
    link/ether fa:b8:73:f4:e3:3a brd ff:ff:ff:ff:ff:ff

You can get this information programmatically via if_nametoindex, 
if_indextoname as well as list them all using if_nameindex or getifaddrs.

All the if_* functions are in net/if.h, whereas getifaddrs is in 

  Thiago Macieira  -  thiago (AT) - thiago (AT)
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : 

More information about the dbus mailing list