The Function body can't be found in the DHCP ,please help me to solve the puzzle!

David W. Hankins David_Hankins at isc.org
Fri Sep 15 16:05:09 UTC 2006


On Fri, Sep 15, 2006 at 11:43:25AM +0800, ???? wrote:
> 		interface_allocate
> 		interface_dereference
> 		interface_reference

You have confronted the black depths of OMAPI.

Observe from includes/dhcpd.h:

    OMAPI_OBJECT_ALLOC_DECL (interface,
			     struct interface_info, dhcp_type_interface)

Observe from common/discover.c:

    OMAPI_OBJECT_ALLOC (interface, struct interface_info, dhcp_type_interface)

And in includes/omapip/omapip.h:

#define OMAPI_OBJECT_ALLOC_DECL(name, stype, type) \
isc_result_t name##_allocate (stype **p, const char *file, int line); \
isc_result_t name##_reference (stype **pptr, stype *ptr, \
                               const char *file, int line); \
isc_result_t name##_dereference (stype **ptr, const char *file, int line);

#define OMAPI_OBJECT_ALLOC(name, stype, type) \
isc_result_t name##_allocate (stype **p, const char *file, int line)          \
{                                                                             \
        return omapi_object_allocate ((omapi_object_t **)p,                   \
                                      type, 0, file, line);                   \
}                                                                             \
                                                                              \
isc_result_t name##_reference (stype **pptr, stype *ptr,                      \
                               const char *file, int line)                    \
{                                                                             \
        return omapi_object_reference ((omapi_object_t **)pptr,               \
                                       (omapi_object_t *)ptr, file, line);    \
}                                                                             \
                                                                              \
isc_result_t name##_dereference (stype **ptr, const char *file, int line)     \
{                                                                             \
        return omapi_object_dereference ((omapi_object_t **)ptr, file, line); \
}

-- 
ISC Training!  October 16-20, 2006, in the San Francisco Bay Area,
covering topics from DNS to DHCP.  Email training at isc.org.
-- 
David W. Hankins	"If you don't do it right the first time,
Software Engineer		you'll just have to do it again."
Internet Systems Consortium, Inc.	-- Jack T. Hankins


More information about the dhcp-users mailing list