Omapi and agent.remote-id

Staffan.Ungsgard at teliasonera.com Staffan.Ungsgard at teliasonera.com
Tue Mar 27 13:05:53 UTC 2007


Hi
I need to get hold of the agent.remote-id via omapi.
As I can tell this isn't supported (yet).
I found this in the archives: http://marc.info/?l=dhcp-server&m=105472469924733&w=2
which explains how to add code in omapi.c to obtain this.

I can't figure out how to call this function "dhcp_lease_stuff_values". It doesn't seem to have a corresponding
calling point in dhcpctl.

-- Staffan

I add the text in the above link below:
-------------------------------------------------------------------------------------------------------------
neufeld at pittstate.edu said:
> My guess is it's not even _on_ some big list. 

There is no support for getting agent.* stuff from OMAPI out of box, the 
patch to code is quite trivial.

I can't make nice patch of the change as I have some other changes in the 
code that surrond this piece but this should be put into server/omapi.c 
function dhcp_lease_stuff_values before /* Write out the inner object, if 
any */ comment

        /* Put out agent options if any */
        if(lease-> agent_options) {
          struct option_cache *oc;
          pair p;

          for(p = lease->agent_options->first; p; p = p -> cdr) {
            oc = (struct option_cache *)p -> car;
            if (oc -> data.len) {
              /* omapi_connection_put_name */
              status = omapi_connection_put_uint16(c,
                                  strlen(oc -> option -> name)+6);
              if(status == ISC_R_SUCCESS)
                status=omapi_connection_copyin(c, (const unsigned char 
*)"agent.",6);
              if(status == ISC_R_SUCCESS)
                status=omapi_connection_copyin(c, (const unsigned char 
*)oc->option->name,
                                               strlen(oc->option->name));
              /* The size */
              if(status == ISC_R_SUCCESS)
                status=omapi_connection_put_uint32(c, oc -> data.len);
              if(status == ISC_R_SUCCESS)
                status=omapi_connection_copyin(c, oc -> data.data,
                                               oc -> data.len);
              if(status != ISC_R_SUCCESS)
                return status;
            }
          }
        }

-- 
Jarkko Torppa, Elisa Internet






More information about the dhcp-users mailing list