05-26-2016 01:57 AM
Hi,
i am wondering how dhcpclient is configured in labview realtime.
My /var/lib/dhcp/dhclient.leases file is empty even though i got an ip from the dhcp-server.
As i just learned labview is using udhcpc instead of dhclient as ps told me:
/bin/busybox.nosuid /sbin/udhcpc -a -b -x hostname NI-sbRIO-9607-030bca33 -i eth0 -r 10.8.0.111 -s /etc/natinst/networking/udhcpc.script -p /var/run/udhcpc.eth0.pid
Where is udhcpc configured in labview realtime ?
Where is udcpc started from?
How to configure udcpc to obtain dhcp-options in a leasefile?
Any help appreciated.
What i am trying to do is to receive an ftp server address via an dhcp-option on the client side.
Thanks in advance
Arne
05-26-2016 10:03 AM
As is shown in the snippet you've posted, the script used for handling DHCP actions is /etc/natinst/networking/udhcpc.script. Start there.
I don't really see a DHCP OPTION type for FTP servers, but I do see TFTP options (meant for loading a boot payload from a bootloader). Some (but not all) DHCP OPTION fields are filled-out by busybox's udhcpc, see: https://git.busybox.net/busybox/tree/networking/udhcp/common.c?h=1_22_stable#n52 (specifically: you'll need the server to be using the 0x42/66 DHCP OPTION).
Of course, I'm assuming I read into what you were asking correctly...
05-26-2016 10:06 AM
Adding a bit more info: udhcpc does not deal in lease files, it instead runs scripts that have access to some of the networking details (both from the configuration as well as the DHCP traffic that it sees when negotiating). You can certainly create a script that would spit out a leasefile, but you're probably more interested in taking some action based on the OPTION field(s) you're interested in...