Commit Graph
95 Commits
Author SHA1 Message Date
David Lawrence 450e60d4f1 _OMAPI_OMAPIP_H_ changed to _OMAPI_OMAPI_H_ to match file name.
include isc/region.h and new omapi/types.h

typedefs moved to omapi/types.h

define protocol port to 7912 so as not to conflict with dhcp server;
this clearly needs more thought. the default omapi port will need to be
server specific rather than library specific.

new public functions, omapi_listener_shutdown, omapi_data_getint.

changed API, omapi_string_totext, omapi_value_getint
2000-01-31 15:04:11 +00:00
David Lawrence 5964aac22f omapi_data_asint renamed to omapi_data_getint, old name of omapi_object_getvalue was wrong 2000-01-31 15:00:44 +00:00
David Lawrence f6826ddc14 typedefs broken out of omapi.h 2000-01-31 14:59:46 +00:00
David Lawrence ea44276a01 renamed omapi_value_asint to omapi_value_getint, added omapi_value_getregion 2000-01-31 14:59:23 +00:00
David Lawrence ae47947fdb Changed API for omapi_string_totext; the string was not always
nul-terminated, so now the function sets a region instead.
2000-01-31 14:58:11 +00:00
David Lawrence eb91bcf9c8 do not need config.h 2000-01-31 14:56:34 +00:00
David Lawrence ed24fabb6d overhaul of way thread locking is done.
ensure only one socket task is outstanding at a time.

allow remote port to be 0, will use OMAPI_PROTOCOL_PORT.

cleaned up error handling so that everything is freed when
something fails.
2000-01-31 14:56:14 +00:00
David Lawrence 7630a0854f free allocated name string in omapi_object_getvalue 2000-01-31 14:52:33 +00:00
David Lawrence 141eff6120 Allow omapi_message_send to be called by the protocol's inner object
(an omapi manager).

overhaul of way connection locking is done.

clarified/fixed where connections can get disconnected.

omapi_value_asint renamed to omapi_value_getint (because
omapi_value_assstr was amusing but in questionable taste)

don't require an object in an OMAPI_OP_UPDATE message; thus the
message can be used just for notification.  (though arguably
OMAPI_OP_STATUS can be used, with a bit more effort.)

free the notify_object if it exists.

signal the notify_object with "status" in preference to the value object.
2000-01-31 14:51:32 +00:00
David Lawrence a89a8e3754 New function, omapi_listener_shutdown, to destroy all memory used by the
listener.

Manage a list of all connections known by the listener, so they can be
shut down by omapi_listener_shutdown.
2000-01-31 14:46:29 +00:00
David Lawrence fbf54b5ee2 ditch omapi_ipv6; the one place that needed it can call isc_net_probeipv6
directly.

note whether memory context is internal to the library so it can be
destroyed by omapi_lib_destroy.

destroy the handle table.

set destroyed pointers to null.

require omapi_lib_init only be called once (without omapi_lib_destroy).
2000-01-31 14:43:31 +00:00
David Lawrence 4bf4456d7f New functions to free the handle table.
Lock the mutex before any use of toptable or the object's handle.
2000-01-31 14:40:08 +00:00
David Lawrence 54a9eb1a8e style lint 2000-01-31 14:38:33 +00:00
David Lawrence a29e02919d new function, omapi_data_getint 2000-01-31 14:38:01 +00:00
David Lawrence 6eb44b7026 Overhaul of the way thread locking for connectiond destruction is done.
Allow only one socket event to be outstanding at a time.

Signal the listener when a connection it accepted has disconnected.

Set some destroyed/freed pointers to NULL after destruction/freeing.

Use isc_net_probeipv6 directly instead of omapi_ipv6 variable.
2000-01-31 14:37:22 +00:00
Mark Andrews cbc3546515 Shutup ambiguous `else' warning. 2000-01-28 05:22:02 +00:00
Andreas Gustafsson 173eac24e6 pointer arithmetic on void pointers is illegal 2000-01-24 18:56:56 +00:00
David Lawrence d0ba01058f set message->h instead of message->handle with the handle from the wire 2000-01-24 15:22:46 +00:00
David Lawrence e069f340d9 no more need to look up the object's handle to ensure validity of the
handle reference in omapi_object_dereference
2000-01-24 15:20:18 +00:00
David Lawrence 647189e3b5 (w/help from Ted) Use the message's h member rather than handle member
to do handle_lookup()s.  also return it for getvalue("handle").
2000-01-24 15:19:22 +00:00
David Lawrence 6d1dc00fbe minor brace cleanup 2000-01-24 05:37:41 +00:00
David Lawrence 8dba294d9d make omapi_message_unregister public 2000-01-24 05:37:19 +00:00
David Lawrence 016440cdc6 no longer define ISC_MEM_DEBUG by default 2000-01-24 05:36:37 +00:00
David Lawrence 8956a08701 mem_put the size of an omapi_value_t struct, not the size of a pointer to it. 2000-01-24 05:35:18 +00:00
David Lawrence 8443d38dce object dereferencing finally works!!! 2000-01-24 05:33:59 +00:00
David Lawrence f07a9b2854 make omapi_message_unregister public
clarify the REQUIRE for omapi_message_unregister.

allow omapi_message_send to be called with a protocol manager object
in addition to a protocol object.

always remove the reference added to the object referred to in an UPDATE
operation, not just on error.  it is a temporary variable and the extra
reference kept the object from being freed.

insist the message being destroyed in message_destroy is unregistered,
which follows logically from how message_destroy would be called anyway.
2000-01-24 05:33:04 +00:00
David Lawrence 22ad324c4a deref the external reference to the protocol object when a new connection
is started on the server so both the connection object and protocol object
are freed when the session ends.
2000-01-24 05:14:24 +00:00
David Lawrence a3035a9c9c break the link between the protocol object and its inner object when
the client is ending its session with the server, so that the connection
object and protocol object can be freed.
2000-01-24 05:05:43 +00:00
David Lawrence e0f30c15b6 checkpoint 2000-01-22 00:18:05 +00:00
David Lawrence 4c9113533d checkpoint 2000-01-17 20:06:37 +00:00
David Lawrence eb421ff1a1 checkpoint 2000-01-17 18:02:11 +00:00
David Lawrence 45d019f745 checkpoint 2000-01-14 23:10:04 +00:00
David Lawrence 6cdff83aae checkpoint 2000-01-13 06:13:26 +00:00
David Lawrence 0b87ef9d0b checkpoint 2000-01-11 01:49:24 +00:00
David Lawrence 904f1ab394 checkpoint 2000-01-06 23:56:51 +00:00
David Lawrence 3eab41102f checkpoint 2000-01-06 03:36:32 +00:00
David Lawrence b11bb1dae5 standard lib api file 2000-01-04 20:26:33 +00:00
David Lawrence d49df8f0d3 renamed from omapip_p.h 2000-01-04 20:19:11 +00:00
David Lawrence 686320ef6e checkpoint 2000-01-04 20:04:42 +00:00
David Lawrence 0ae0a1f038 checkpoint conversion to ISC (doc/dev/coding.html) style.
* no spaces around " -> " in indirect postfix expression.
  * no space between function name and open parenthesis.
  * no space between array name and open bracket.
  * use NULL not 0 for pointers.
  * explicitly compare pointers to NULL.
  * explicitly compare integers to 0.
  * Do not cast NULL.
  * return type of function declaration on line by itself.
  * open brace of function definition follows close parenthesis if parameters
    all fit on one line.
  * comment-only lines start with /* on line by itself, and end with */
    on line by itself.
  * variable names in structures separated from their types in a column.
  * name the parameters in function prototypes.
  * ifndef multiple header file inclusion.

and other BIND9 conventions not in coding.html:

  * private structures defined in relevant source module, not private header.
  * RCS /* $Id: $ */ comments.
  * Principal Author (Ted Lemon) comments.
  * Updated ISC copyrights.
  * Parenthesize value of return().
  * Parenthesize argument of sizeof().
  * "unsigned int foo" not "unsigned foo".
  * ISC_LANG_(BEGIN|END)DECLS in header files.
  * header files included directly by source/header file that needs them.
  * ... and others I am probably forgetting.

and conversion to some libisc.a modules:

  * use isc/int.h for isc_uintXX_t types, not u_intXX_t.
  * use isc/assertions.h for REQUIRE() and INSIST().
  * use isc/error.h for UNEXPECTED_ERROR.
  * use isc/boolean.h for isc_boolean_t flags instead of int flags.
  * use isc/net.h for networking types.
  * use isc/netdb.h for gethostby*.

STILL TO COME ...

  * more isc_boolean_t.
  * isc/time.h to replace struct timeval.
  * isc/socket.h to replace socket/listen/select/etc.
  * isc/mem.h to replace malloc/free.
  * namespace overhaul & omapi/compatibility.h.

Please collect all your belongings but stand clear of the doors until this
train has come to a complete stop.
1999-11-02 04:01:34 +00:00
David Lawrence 80d1f35fc3 boilerplate 1999-11-01 02:32:57 +00:00
David Lawrence 74bd12e816 superseded by lib/isc/result.c 1999-10-31 23:27:35 +00:00
David Lawrence a376977ecb moved to bin/tests/omapi_test.c 1999-10-31 18:00:27 +00:00
David Lawrence bdc1edb6ea initial copy from the DHCP source pool 1999-10-27 23:55:07 +00:00
David Lawrence f3ff03fc48 initial copy from the DHCP source pool 1999-10-27 22:24:32 +00:00