39 const char *server_name,
47 log_debug (
"omapi_protocol_connect(%s port=%d)", server_name, port);
77 if (!
obj -> default_auth) {
113 log_debug (
"omapi_protocol_send_intro()");
173 log_debug (
"omapi_protocol_send_message(): "
174 "op=%s handle=%#lx id=%#lx rid=%#lx",
177 (
long)
p -> next_xid, (
long)
m -> rid);
182 for (ra =
p -> remote_auth_list; ra; ra = ra -> next) {
190 }
else if (
p -> remote_auth_list) {
191 ra =
p -> default_auth;
197 m -> authid = ra -> remote_handle;
215 "output-authenticator",
258 m ->
id =
p -> next_xid++;
328 "output-authenticator",
354#if defined (DEBUG_MEMORY_LEAKAGE)
365 if (!
strcmp (name,
"connect")) {
366#if defined (DEBUG_MEMORY_LEAKAGE)
381 if (!
strcmp (name,
"status")) {
394 if (!
strcmp (name,
"disconnect")) {
395#if defined (DEBUG_MEMORY_LEAKAGE)
397 log_info (
"generation %ld: %ld new, %ld outstanding, %ld%s",
403#if defined (DEBUG_MEMORY_LEAKAGE)
406#if defined (DEBUG_RC_HISTORY_EXHAUSTIVELY)
410 if (
m -> protocol_object ==
p) {
421 if (
strcmp (name,
"ready")) {
423 return (*(
p ->
inner -> type -> signal_handler)) (h,
436 switch (
p -> state) {
454 if (
p -> default_auth) {
457 p -> default_auth -> a,
480#if defined (DEBUG_MEMORY_LEAKAGE)
482 log_info (
"%s %ld: %ld new, %ld outstanding, %ld%s",
488#if (defined (DEBUG_MEMORY_LEAKAGE) || defined (DEBUG_MALLOC_POOL))
491#if defined (DEBUG_RC_HISTORY_EXHAUSTIVELY)
494#if defined (DEBUG_MEMORY_LEAKAGE)
511 if (
p -> message -> authid) {
513 (&
p -> message -> id_object, h,
514 p -> message -> authid));
516 p -> verify_result = status;
521 p -> message -> id_object);
531 p -> message -> h =
th;
538 (0,
c, (
p -> header_size -
549 p -> reading_message_values = 1;
571 if (
p -> reading_message_values) {
572 p -> reading_message_values = 0;
579 if (
p -> message -> authlen == 0)
639 p ->
value -> u.buffer.len);
642 if (
p -> reading_message_values) {
645 p -> message -> id_object,
648 if (!
p -> message ->
object) {
652 (&
p -> message ->
object,
MDL));
660 p -> message -> id_object,
674 if (
p -> message -> id_object) {
686 "input-authenticator",
697 &
p -> message -> authenticator,
699 p -> message -> authlen);
709 (
p -> message -> authenticator -> u.buffer.value,
c,
710 p -> message -> authlen);
713 if (
p -> message -> id_object &&
715 p -> message -> authlen) ||
717 p -> message -> authenticator -> u.buffer.value,
718 p -> message -> authlen) != 0))) {
732 p -> message ->
id, (
char *)0);
743#if defined (DEBUG_MEMORY_LEAKAGE)
744 log_info (
"generation %ld: %ld new, %ld outstanding, %ld%s",
749#if (defined (DEBUG_MEMORY_LEAKAGE) || defined (DEBUG_MALLOC_POOL))
752#if defined (DEBUG_RC_HISTORY_EXHAUSTIVELY)
755#if defined (DEBUG_MEMORY_LEAKAGE)
785 log_debug (
"omapi_protocol_add_auth(name=%s)",
789 if (
p -> verify_auth) {
798 if (
p -> default_auth && !
p -> remote_auth_list) {
799 if (
p -> default_auth -> a !=
ao) {
805 p -> remote_auth_list =
p -> default_auth;
806 p -> default_auth -> remote_handle =
handle;
822 r -> next =
p -> remote_auth_list;
823 p -> remote_auth_list =
r;
839 for (
r =
p -> remote_auth_list;
r;
r =
r -> next)
840 if (
r -> remote_handle ==
handle)
862 if (!
value -> u.object) {
865 for (
r =
p -> remote_auth_list;
r;
r =
r -> next)
866 if (
r -> a ==
value -> u.object)
872 p -> default_auth =
r;
878 if (h ->
inner && h ->
inner -> type -> set_value)
879 return (*(h ->
inner -> type -> set_value))
896 if (!
p -> default_auth)
900 p -> default_auth -> a,
MDL);
903 if (h ->
inner && h ->
inner -> type -> get_value)
904 return (*(h ->
inner -> type -> get_value))
922 if (
p -> default_auth && !
p -> remote_auth_list)
925 while (
p -> remote_auth_list) {
927 p -> remote_auth_list =
p -> remote_auth_list -> next;
945 return (*(
p ->
inner -> type -> stuff_values)) (
c, id,
983 l -> verify_auth = verify_auth;
986 if (h -> outer !=
NULL) {
1022 obj -> insecure = 1;
1045 if (
strcmp (name,
"connect")) {
1046 if (
p ->
inner &&
p ->
inner -> type -> signal_handler)
1047 return (*(
p ->
inner -> type -> signal_handler))
1061 obj -> verify_auth =
p -> verify_auth;
1062 obj -> insecure =
p -> insecure;
1096 if (h ->
inner && h ->
inner -> type -> set_value)
1097 return (*(h ->
inner -> type -> set_value))
1110 if (h ->
inner && h ->
inner -> type -> get_value)
1111 return (*(h ->
inner -> type -> get_value))
1135 return (*(
p ->
inner -> type -> stuff_values)) (
c, id,
1143 unsigned rid,
const char *
msg)
1172 "result", (
int)waitstatus);
1235 "notify-object",
po);
isc_result_t omapi_connection_get_uint16(omapi_object_t *, u_int16_t *)
isc_result_t omapi_connection_put_uint32(omapi_object_t *, u_int32_t)
isc_result_t omapi_connection_copyout(unsigned char *, omapi_object_t *, unsigned)
isc_result_t omapi_connection_put_uint16(omapi_object_t *, u_int32_t)
isc_result_t omapi_connection_copyin(omapi_object_t *, const unsigned char *, unsigned)
isc_result_t omapi_connection_require(omapi_object_t *, unsigned)
isc_result_t omapi_connection_get_uint32(omapi_object_t *, u_int32_t *)
isc_result_t omapi_value_dereference(omapi_value_t **, const char *, int)
isc_result_t omapi_protocol_connect(omapi_object_t *, const char *, unsigned, omapi_object_t *)
isc_result_t omapi_generic_new(omapi_object_t **, const char *, int)
isc_result_t omapi_make_object_value(omapi_value_t **, omapi_data_string_t *, omapi_object_t *, const char *, int)
isc_result_t omapi_set_boolean_value(omapi_object_t *, omapi_object_t *, const char *, int)
#define OMAPI_OBJECT_ALLOC(name, stype, type)
isc_result_t omapi_set_value(omapi_object_t *, omapi_object_t *, omapi_data_string_t *, omapi_typed_data_t *)
isc_result_t omapi_message_process(omapi_object_t *, omapi_object_t *)
isc_result_t omapi_object_dereference(omapi_object_t **, const char *, int)
isc_result_t omapi_set_object_value(omapi_object_t *, omapi_object_t *, const char *, omapi_object_t *)
isc_result_t omapi_data_string_new(omapi_data_string_t **, unsigned, const char *, int)
isc_result_t omapi_message_register(omapi_object_t *)
#define OMAPI_NOTIFY_PROTOCOL
isc_result_t omapi_object_handle(omapi_handle_t *, omapi_object_t *)
isc_result_t omapi_disconnect(omapi_object_t *, int)
omapi_object_type_t * omapi_type_auth_key
isc_result_t omapi_set_value_str(omapi_object_t *, omapi_object_t *, const char *, omapi_typed_data_t *)
isc_result_t omapi_connect(omapi_object_t *, const char *, unsigned)
isc_result_t omapi_typed_data_dereference(omapi_typed_data_t **, const char *, int)
isc_result_t omapi_object_reference(omapi_object_t **, omapi_object_t *, const char *, int)
omapi_object_type_t * omapi_type_protocol
isc_result_t omapi_data_string_dereference(omapi_data_string_t **, const char *, int)
isc_result_t omapi_signal_in(omapi_object_t *, const char *,...)
isc_result_t omapi_signal(omapi_object_t *, const char *,...)
unsigned int omapi_handle_t
int omapi_ds_strcmp(omapi_data_string_t *, const char *)
isc_result_t omapi_listener_configure_security(omapi_object_t *, isc_result_t(*)(omapi_object_t *, omapi_addr_t *))
omapi_object_type_t * omapi_type_connection
isc_result_t omapi_set_string_value(omapi_object_t *, omapi_object_t *, const char *, const char *)
isc_result_t omapi_connection_output_auth_length(omapi_object_t *, unsigned *)
isc_result_t omapi_typed_data_new(const char *, int, omapi_typed_data_t **, omapi_datatype_t,...)
isc_result_t omapi_message_unregister(omapi_object_t *)
void * dmalloc(size_t, const char *, int)
isc_result_t omapi_stuff_values(omapi_object_t *, omapi_object_t *, omapi_object_t *)
void dfree(void *, const char *, int)
isc_result_t omapi_get_value_str(omapi_object_t *, omapi_object_t *, const char *, omapi_value_t **)
omapi_object_type_t * omapi_type_protocol_listener
isc_result_t omapi_listen(omapi_object_t *, unsigned, int)
isc_result_t omapi_message_new(omapi_object_t **, const char *, int)
omapi_object_type_t * omapi_type_message
isc_result_t omapi_set_int_value(omapi_object_t *, omapi_object_t *, const char *, int)
int int int log_debug(const char *,...) __attribute__((__format__(__printf__
@ omapi_protocol_value_wait
@ omapi_protocol_signature_wait
@ omapi_protocol_value_length_wait
@ omapi_protocol_intro_wait
@ omapi_protocol_name_wait
@ omapi_protocol_header_wait
@ omapi_protocol_name_length_wait
omapi_message_object_t * omapi_registered_messages
#define OMAPI_PROTOCOL_VERSION
int int log_info(const char *,...) __attribute__((__format__(__printf__
isc_result_t omapi_protocol_lookup_auth(omapi_object_t **a, omapi_object_t *po, omapi_handle_t handle)
isc_result_t omapi_protocol_send_status(omapi_object_t *po, omapi_object_t *id, isc_result_t waitstatus, unsigned rid, const char *msg)
isc_result_t omapi_protocol_listener_stuff(omapi_object_t *c, omapi_object_t *id, omapi_object_t *p)
isc_result_t omapi_protocol_add_auth(omapi_object_t *po, omapi_object_t *ao, omapi_handle_t handle)
isc_result_t omapi_protocol_send_intro(omapi_object_t *h, unsigned ver, unsigned hsize)
isc_result_t omapi_protocol_signal_handler(omapi_object_t *h, const char *name, va_list ap)
isc_result_t omapi_protocol_send_open(omapi_object_t *po, omapi_object_t *id, const char *type, omapi_object_t *object, unsigned flags)
isc_result_t omapi_protocol_send_update(omapi_object_t *po, omapi_object_t *id, unsigned rid, omapi_object_t *object)
isc_result_t omapi_protocol_get_value(omapi_object_t *h, omapi_object_t *id, omapi_data_string_t *name, omapi_value_t **value)
isc_boolean_t omapi_protocol_authenticated(omapi_object_t *h)
isc_result_t omapi_protocol_send_message(omapi_object_t *po, omapi_object_t *id, omapi_object_t *mo, omapi_object_t *omo)
isc_result_t omapi_protocol_listener_signal(omapi_object_t *o, const char *name, va_list ap)
isc_result_t omapi_protocol_destroy(omapi_object_t *h, const char *file, int line)
isc_result_t omapi_protocol_listen(omapi_object_t *h, unsigned port, int max)
isc_result_t omapi_protocol_listener_get_value(omapi_object_t *h, omapi_object_t *id, omapi_data_string_t *name, omapi_value_t **value)
isc_result_t omapi_protocol_set_value(omapi_object_t *h, omapi_object_t *id, omapi_data_string_t *name, omapi_typed_data_t *value)
isc_result_t omapi_protocol_listener_set_value(omapi_object_t *h, omapi_object_t *id, omapi_data_string_t *name, omapi_typed_data_t *value)
isc_result_t omapi_protocol_stuff_values(omapi_object_t *c, omapi_object_t *id, omapi_object_t *p)
isc_result_t omapi_protocol_configure_security(omapi_object_t *h, isc_result_t(*verify_addr)(omapi_object_t *, omapi_addr_t *), isc_result_t(*verify_auth)(omapi_object_t *, omapi_auth_key_t *))
isc_result_t omapi_protocol_listener_destroy(omapi_object_t *h, const char *file, int line)
#define DHCP_R_VERSIONMISMATCH
#define DHCP_R_INVALIDARG
#define DHCP_R_PROTOCOLERROR
#define DHCP_R_KEY_UNKNOWN
#define DHCP_R_INCOMPLETE
#define DHCP_R_INVALIDKEY