Hi Martin,
I am trying to implement what Angelo is trying to do, and what you have suggested, namely, add the hostname option using DHCP client Option 12 in dhcpcInt.c, but there are a few things I don't understand in RTCS.
First, I see in DHCPCLNT_fill_options( ) the comments say "Only the following options are allowed for a DHCP Client message. Client ID, Use 'file'/'sname' fields, Parameter request list, IP address lease time, Class Id, Max message size, Requested IP addr. DO NOT change the order of insertion into the buffer, as other functions will depend on the order given here."
Questions:
1) Why are those the only options allowed? It seems that I could add any option which complies with RFC 2132.
2) Why can't the order change? What "other functions"? These options quoted above are not in the order presented in RFC 2132, and from my understanding of 2132, the options can be in any order.
Next, I see the DHCP_FILL( ) macro used which I would like to add option 12, however this macro uses DHCP_find_option( ) to first find the option code in the OPT_BUFF, therefore some code must first stuff option code 12 in the OPT_BUFF before I can even add option 12 to DHCPCLNT_fill_options( ) and I cannot find such code.
Please try to find where in RTCS the option codes are first stuffed into the DHCP client's buffer, and why it says "Only the following options are allowed for a DHCP Client message" in dhcpcInt.c
Thanks,
Gene