defining network interfaces on osx

29 views
Skip to first unread message

Abhijith

unread,
May 23, 2012, 10:51:48 AM5/23/12
to uni...@googlegroups.com
I am using unimrcp on osx lion. It works well for the most part. Unlike linux , I cannot seem to declare the network interfaces to use and have to hardcode my ip address. 
This is the output of ifconfig
.....
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=2b<RXCSUM,TXCSUM,VLAN_HWTAGGING,TSO4>
ether c4:2c:03:39:c9:b6 
media: autoselect (none)
status: inactive
en1: flags=8963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
ether 60:33:4b:29:88:0a 
inet6 fe80::6233:4bff:fe29:880a%en1 prefixlen 64 scopeid 0x5 
inet 192.168.220.102 netmask 0xfffffe00 broadcast 192.168.221.255
media: autoselect
status: active
....

In the configuration xml if i use the interface name for any ip address field -- for eg <param name="client-ip" value="en1"/>
then the server prints an error
 
tport_server_addrinfo(0x7fc39b004880): su_getaddrinfo(en1, 8066) for udp: nodename nor servname provided, or not known
nta: bind(en1:8066;transport=udp): No such file or directory

Is there any way i can use interface name instead of declaring IP addresses ?



Arsen Chaloyan

unread,
Jun 4, 2012, 8:50:59 PM6/4/12
to uni...@googlegroups.com
Normally, you cannot pass an interface name in place where an IP
address/hostname is expected. However, what you can do is to get
programmatically the IP address by the given interface name. Then,
instead of "client-ip" or as an alternative to "client-ip", one could
specify, let's say, "client-iface".

Use getifaddrs to get all the net interfaces. Find the one which you
need looking for ifa_name, and then use its ifa_addrs everywhere where
the local IP address is supposed to be used.
> --
> You received this message because you are subscribed to the Google Groups
> "UniMRCP" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/unimrcp/-/WiAa4seG4I8J.
> To post to this group, send email to uni...@googlegroups.com.
> To unsubscribe from this group, send email to
> unimrcp+u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/unimrcp?hl=en.



--
Arsen Chaloyan
Author of UniMRCP
http://www.unimrcp.org
Reply all
Reply to author
Forward
0 new messages