summaryrefslogtreecommitdiff
path: root/omapip
diff options
context:
space:
mode:
authorTomek Mrugalski <tomek@isc.org>2022-01-19 20:14:16 +0100
committerTomek Mrugalski <tomek@isc.org>2022-01-20 12:04:28 +0100
commitf6b8f48d1665c4487dedbcfa4dca435a0d67ddeb (patch)
tree19926f31f56890bc8c7f5d3bc5b2e2c16b96794e /omapip
parent429a56d73c0f9f2edf400fd6313850a3ce4fd809 (diff)
downloadisc-dhcp-f6b8f48d1665c4487dedbcfa4dca435a0d67ddeb.tar.gz
[#189] Whitespace fixes in opened files
Diffstat (limited to 'omapip')
-rw-r--r--omapip/alloc.c33
-rw-r--r--omapip/array.c3
-rw-r--r--omapip/auth.c4
-rw-r--r--omapip/buffer.c19
-rw-r--r--omapip/connection.c28
-rw-r--r--omapip/dispatch.c70
-rw-r--r--omapip/generic.c14
-rw-r--r--omapip/handle.c10
-rw-r--r--omapip/hash.c8
-rw-r--r--omapip/isclib.c6
-rw-r--r--omapip/listener.c15
-rw-r--r--omapip/message.c16
-rw-r--r--omapip/omapi.311
-rw-r--r--omapip/protocol.c26
-rw-r--r--omapip/result.c2
-rw-r--r--omapip/support.c8
-rw-r--r--omapip/trace.c18
17 files changed, 143 insertions, 148 deletions
diff --git a/omapip/alloc.c b/omapip/alloc.c
index e68aa605..6569f431 100644
--- a/omapip/alloc.c
+++ b/omapip/alloc.c
@@ -141,7 +141,7 @@ dmalloc(size_t size, const char *file, int line) {
return bar;
}
-void
+void
dfree(void *ptr, const char *file, int line) {
if (!ptr) {
log_error ("dfree %s(%d): free on null pointer.", file, line);
@@ -208,7 +208,7 @@ dfree(void *ptr, const char *file, int line) {
/* For allocation functions that keep their own free lists, we want to
account for the reuse of the memory. */
-void
+void
dmalloc_reuse(void *foo, const char *file, int line, int justref) {
struct dmalloc_preamble *dp;
@@ -333,7 +333,7 @@ void dmalloc_dump_outstanding ()
if (!inhistory)
#endif
log_info (" %s(%d): %ld",
- dp -> file, dp -> line,
+ dp -> file, dp -> line,
(long) dp -> size);
}
#endif
@@ -535,11 +535,11 @@ isc_result_t omapi_object_allocate (omapi_object_t **o,
tsize = (*type -> sizer) (size);
else
tsize = type -> size;
-
+
/* Sanity check. */
if (tsize < sizeof (omapi_object_t))
return DHCP_R_INVALIDARG;
-
+
foo = dmalloc (tsize, file, line);
if (!foo)
return ISC_R_NOMEMORY;
@@ -610,7 +610,7 @@ isc_result_t omapi_object_dereference (omapi_object_t **h,
return DHCP_R_INVALIDARG;
#endif
}
-
+
if ((*h) -> refcnt <= 0) {
#if defined (POINTER_DEBUG)
log_error ("%s(%d): dereference of pointer with refcnt of zero!",
@@ -624,7 +624,7 @@ isc_result_t omapi_object_dereference (omapi_object_t **h,
return DHCP_R_INVALIDARG;
#endif
}
-
+
/* See if this object's inner object refers to it, but don't
count this as a reference if we're being asked to free the
reference from the inner object. */
@@ -695,7 +695,7 @@ isc_result_t omapi_object_dereference (omapi_object_t **h,
rc_register (file, line, h, hp,
0, 1, hp -> type -> rc_flag);
if (handle_reference) {
- if (omapi_handle_clear(hp->handle) !=
+ if (omapi_handle_clear(hp->handle) !=
ISC_R_SUCCESS) {
log_debug("Attempt to clear null "
"handle pointer");
@@ -729,7 +729,7 @@ isc_result_t omapi_buffer_new (omapi_buffer_t **h,
{
omapi_buffer_t *t;
isc_result_t status;
-
+
t = (omapi_buffer_t *)dmalloc (sizeof *t, file, line);
if (!t)
return ISC_R_NOMEMORY;
@@ -777,7 +777,7 @@ isc_result_t omapi_buffer_dereference (omapi_buffer_t **h,
return DHCP_R_INVALIDARG;
#endif
}
-
+
if ((*h) -> refcnt <= 0) {
#if defined (POINTER_DEBUG)
log_error ("%s(%d): dereference of pointer with refcnt of zero!",
@@ -912,7 +912,7 @@ isc_result_t omapi_typed_data_dereference (omapi_typed_data_t **h,
return DHCP_R_INVALIDARG;
#endif
}
-
+
if ((*h) -> refcnt <= 0) {
#if defined (POINTER_DEBUG)
log_error ("%s(%d): dereference of pointer with refcnt of zero!",
@@ -926,7 +926,7 @@ isc_result_t omapi_typed_data_dereference (omapi_typed_data_t **h,
return DHCP_R_INVALIDARG;
#endif
}
-
+
--((*h) -> refcnt);
rc_register (file, line, h, *h, (*h) -> refcnt, 1, RC_MISC);
if ((*h) -> refcnt <= 0 ) {
@@ -999,7 +999,7 @@ isc_result_t omapi_data_string_dereference (omapi_data_string_t **h,
return DHCP_R_INVALIDARG;
#endif
}
-
+
if ((*h) -> refcnt <= 0) {
#if defined (POINTER_DEBUG)
log_error ("%s(%d): dereference of pointer with refcnt of zero!",
@@ -1071,7 +1071,7 @@ isc_result_t omapi_value_dereference (omapi_value_t **h,
return DHCP_R_INVALIDARG;
#endif
}
-
+
if ((*h) -> refcnt <= 0) {
#if defined (POINTER_DEBUG)
log_error ("%s(%d): dereference of pointer with refcnt of zero!",
@@ -1085,7 +1085,7 @@ isc_result_t omapi_value_dereference (omapi_value_t **h,
return DHCP_R_INVALIDARG;
#endif
}
-
+
--((*h) -> refcnt);
rc_register (file, line, h, *h, (*h) -> refcnt, 1, RC_MISC);
if ((*h) -> refcnt == 0) {
@@ -1153,7 +1153,7 @@ isc_result_t omapi_addr_list_dereference (omapi_addr_list_t **h,
return DHCP_R_INVALIDARG;
#endif
}
-
+
if ((*h) -> refcnt <= 0) {
#if defined (POINTER_DEBUG)
log_error ("%s(%d): dereference of pointer with zero refcnt!",
@@ -1176,4 +1176,3 @@ isc_result_t omapi_addr_list_dereference (omapi_addr_list_t **h,
*h = 0;
return ISC_R_SUCCESS;
}
-
diff --git a/omapip/array.c b/omapip/array.c
index 83d7cf30..760b80ee 100644
--- a/omapip/array.c
+++ b/omapip/array.c
@@ -122,7 +122,7 @@ isc_result_t omapi_array_set (omapi_array_t *array, void *ptr, int index,
if (array -> data [index]) {
status = ((*array -> deref) (&array -> data [index],
file, line));
-
+
if (status != ISC_R_SUCCESS)
return status;
}
@@ -153,4 +153,3 @@ isc_result_t omapi_array_lookup (char **ptr, omapi_array_t *array, int index,
array -> data [index], file, line);
return ISC_R_NOTFOUND;
}
-
diff --git a/omapip/auth.c b/omapip/auth.c
index 894f93e8..1641a8cb 100644
--- a/omapip/auth.c
+++ b/omapip/auth.c
@@ -66,7 +66,7 @@ isc_result_t omapi_auth_key_destroy (omapi_object_t *h,
omapi_data_string_dereference(&a->key, MDL);
if (a->tsec_key != NULL)
dns_tsec_destroy(&a->tsec_key);
-
+
return ISC_R_SUCCESS;
}
@@ -100,7 +100,7 @@ isc_result_t omapi_auth_key_enter (omapi_auth_key_t *a)
/*
* If possible create a tsec structure for this key,
- * if we can't create the structure we put out a warning
+ * if we can't create the structure we put out a warning
* and continue.
*/
status = isclib_make_dst_key(a->name, a->algorithm,
diff --git a/omapip/buffer.c b/omapip/buffer.c
index 041be497..e521a435 100644
--- a/omapip/buffer.c
+++ b/omapip/buffer.c
@@ -146,7 +146,7 @@ static isc_result_t omapi_connection_reader_trace (omapi_object_t *h,
int read_status;
omapi_connection_object_t *c;
unsigned bytes_to_read;
-
+
if (!h || h -> type != omapi_type_connection)
return DHCP_R_INVALIDARG;
c = (omapi_connection_object_t *)h;
@@ -421,7 +421,7 @@ isc_result_t omapi_connection_copyout (unsigned char *buf,
buffer -> head = first_byte + bytes_this_copy - 1;
c -> in_bytes -= bytes_this_copy;
}
-
+
if (!BYTES_IN_BUFFER (buffer))
buffer = buffer -> next;
}
@@ -516,14 +516,14 @@ isc_result_t omapi_connection_writer (omapi_object_t *h)
isc_result_t status;
trace_iov_t iov [2];
int32_t connect_index;
-
+
connect_index = htonl (c -> index);
-
+
iov [0].buf = (char *)&connect_index;
iov [0].len = sizeof connect_index;
iov [1].buf = &buffer -> buf [buffer -> tail];
iov [1].len = bytes_written;
-
+
status = (trace_write_packet_iov
(trace_connection_input, 2, iov,
MDL));
@@ -545,11 +545,11 @@ isc_result_t omapi_connection_writer (omapi_object_t *h)
if (bytes_written != bytes_this_write)
return ISC_R_INPROGRESS;
}
-
+
if (!BYTES_IN_BUFFER (buffer))
buffer = buffer -> next;
}
-
+
/* Get rid of any output buffers we emptied. */
buffer = (omapi_buffer_t *)0;
while (c -> outbufs &&
@@ -598,7 +598,7 @@ isc_result_t omapi_connection_put_uint32 (omapi_object_t *c,
u_int32_t inbuf;
inbuf = htonl (value);
-
+
return omapi_connection_copyin (c, (unsigned char *)&inbuf,
sizeof inbuf);
}
@@ -624,7 +624,7 @@ isc_result_t omapi_connection_put_uint16 (omapi_object_t *c,
u_int16_t inbuf;
inbuf = htons (value);
-
+
return omapi_connection_copyin (c, (unsigned char *)&inbuf,
sizeof inbuf);
}
@@ -740,4 +740,3 @@ isc_result_t omapi_connection_put_named_uint32 (omapi_object_t *c,
status = omapi_connection_put_uint32(c, value);
return (status);
}
-
diff --git a/omapip/connection.c b/omapip/connection.c
index 000f6d57..68baa660 100644
--- a/omapip/connection.c
+++ b/omapip/connection.c
@@ -163,7 +163,7 @@ isc_result_t omapi_connect_list (omapi_object_t *c,
local_sin.sin_family = AF_INET;
memset (&local_sin.sin_zero, 0,
sizeof local_sin.sin_zero);
-
+
if (bind (obj -> socket, (struct sockaddr *)&local_sin,
sizeof local_sin) < 0) {
omapi_connection_object_t **objp = &obj;
@@ -196,7 +196,7 @@ isc_result_t omapi_connect_list (omapi_object_t *c,
omapi_connection_dereference (&obj, MDL);
return ISC_R_UNEXPECTED;
}
-
+
/* Set the file to nonblocking mode. */
if (fcntl (obj -> socket, F_SETFL, O_NONBLOCK) < 0) {
omapi_connection_dereference (&obj, MDL);
@@ -213,7 +213,7 @@ isc_result_t omapi_connect_list (omapi_object_t *c,
(char *)&flag, sizeof(flag)) < 0) {
omapi_connection_dereference (&obj, MDL);
return ISC_R_UNEXPECTED;
- }
+ }
#endif
status = (omapi_register_io_object
@@ -285,7 +285,7 @@ void omapi_connection_register (omapi_connection_object_t *obj,
#if defined (TRACING)
if (trace_record ()) {
/* Connection registration packet:
-
+
int32_t index
int32_t listener_index [-1 means no listener]
u_int16_t remote_port
@@ -365,7 +365,7 @@ static void trace_connect_input (trace_type_t *ttype,
omapi_listener_reference (&listener, lp, MDL);
omapi_listener_dereference (&lp, MDL);
break;
- }
+ }
} omapi_array_foreach_end (trace_listeners,
omapi_listener_object_t, lp);
if (!listener) {
@@ -411,7 +411,7 @@ static void trace_connect_input (trace_type_t *ttype,
}
} omapi_array_foreach_end (omapi_connections,
omapi_connection_object_t, lp);
-
+
log_error ("Spurious traced connect - index %ld, addr %s, port %d",
(long int)connect_index, inet_ntoa (remote.sin_addr),
ntohs (remote.sin_port));
@@ -428,7 +428,7 @@ static void trace_disconnect_input (trace_type_t *ttype,
log_error ("trace disconnect: wrong length %d", length);
return;
}
-
+
index = (int32_t *)buf;
omapi_array_foreach_begin (omapi_connections,
@@ -613,7 +613,7 @@ isc_result_t omapi_connection_connect (omapi_object_t *h)
* pass it on as a signal.
*/
status = omapi_connection_connect_internal (h);
- if (status == ISC_R_INPROGRESS)
+ if (status == ISC_R_INPROGRESS)
return ISC_R_INPROGRESS;
if (status != ISC_R_SUCCESS)
@@ -705,7 +705,7 @@ static isc_result_t omapi_connection_connect_internal (omapi_object_t *h)
}
c -> state = omapi_connection_connected;
}
-
+
/* I don't know why this would fail, so I'm tempted not to test
the return value. */
sl = sizeof (c -> local_addr);
@@ -970,7 +970,7 @@ isc_result_t omapi_connection_set_value (omapi_object_t *h,
return ISC_R_SUCCESS;
}
-
+
if (h -> inner && h -> inner -> type -> set_value)
return (*(h -> inner -> type -> set_value))
(h -> inner, id, name, value);
@@ -1013,7 +1013,7 @@ isc_result_t omapi_connection_get_value (omapi_object_t *h,
status = dst_key_sigsize(c->in_key, &sigsize);
if (status != ISC_R_SUCCESS) {
return(status);
- }
+ }
return omapi_make_int_value(value, name, sigsize, MDL);
@@ -1040,11 +1040,11 @@ isc_result_t omapi_connection_get_value (omapi_object_t *h,
status = dst_key_sigsize(c->out_key, &sigsize);
if (status != ISC_R_SUCCESS) {
return(status);
- }
+ }
return omapi_make_int_value(value, name, sigsize, MDL);
}
-
+
if (h -> inner && h -> inner -> type -> get_value)
return (*(h -> inner -> type -> get_value))
(h -> inner, id, name, value);
@@ -1081,7 +1081,7 @@ isc_result_t omapi_connection_signal_handler (omapi_object_t *h,
#ifdef DEBUG_PROTOCOL
log_debug ("omapi_connection_signal_handler(%s)", name);
#endif
-
+
if (h -> inner && h -> inner -> type -> signal_handler)
return (*(h -> inner -> type -> signal_handler)) (h -> inner,
name, ap);
diff --git a/omapip/dispatch.c b/omapip/dispatch.c
index 0fd8ed34..426455ef 100644
--- a/omapip/dispatch.c
+++ b/omapip/dispatch.c
@@ -53,14 +53,14 @@ register_eventhandler(struct eventqueue **queue, void (*handler)(void *))
return; /* handler already registered */
t = q;
}
-
+
q = ((struct eventqueue *)dmalloc(sizeof(struct eventqueue), MDL));
if (!q)
log_fatal("register_eventhandler: no memory!");
memset(q, 0, sizeof *q);
if (t)
t->next = q;
- else
+ else
*queue = q;
q->handler = handler;
return;
@@ -70,7 +70,7 @@ void
unregister_eventhandler(struct eventqueue **queue, void (*handler)(void *))
{
struct eventqueue *t, *q;
-
+
/* traverse to end of list */
t= NULL;
for (q = *queue ; q ; q = q->next) {
@@ -93,7 +93,7 @@ trigger_event(struct eventqueue **queue)
struct eventqueue *q;
for (q=*queue ; q ; q=q->next) {
- if (q->handler)
+ if (q->handler)
(*q->handler)(NULL);
}
}
@@ -102,7 +102,7 @@ trigger_event(struct eventqueue **queue)
* Callback routine to connect the omapi I/O object and socket with
* the isc socket code. The isc socket code will call this routine
* which will then call the correct local routine to process the bytes.
- *
+ *
* Currently we are always willing to read more data, this should be modified
* so that on connections we don't read more if we already have enough.
*
@@ -159,13 +159,13 @@ omapi_iscsock_cb(isc_task_t *task,
if (obj->closed == ISC_TRUE) {
return(0);
}
-#endif
+#endif
if ((flags == ISC_SOCKFDWATCH_READ) &&
(obj->reader != NULL) &&
(obj->inner != NULL)) {
status = obj->reader(obj->inner);
- /*
+ /*
* If we are shutting down (basically tried to
* read and got no bytes) we don't need to try
* again.
@@ -218,7 +218,7 @@ isc_result_t omapi_register_io_object (omapi_object_t *h,
omapi_io_states.refcnt = 1;
omapi_io_states.type = omapi_type_io_object;
}
-
+
obj = (omapi_io_object_t *)0;
status = omapi_io_allocate (&obj, MDL);
if (status != ISC_R_SUCCESS)
@@ -239,7 +239,7 @@ isc_result_t omapi_register_io_object (omapi_object_t *h,
}
/*
- * Attach the I/O object to the isc socket library via the
+ * Attach the I/O object to the isc socket library via the
* fdwatch function. This allows the socket library to watch
* over a socket that we built. If there are both a read and
* a write socket we asssume they are the same socket.
@@ -317,7 +317,7 @@ isc_result_t omapi_reregister_io_object (omapi_object_t *h,
if ((!h -> outer) || (h -> outer -> type != omapi_type_io_object)) {
/*
- * If we don't have an object or if the type isn't what
+ * If we don't have an object or if the type isn't what
* we expect do the normal registration (which will overwrite
* an incorrect type, that's what we did historically, may
* want to change that)
@@ -348,7 +348,7 @@ isc_result_t omapi_reregister_io_object (omapi_object_t *h,
}
isc_socket_fdwatchpoke(obj->fd, fd_flags);
-
+
return (ISC_R_SUCCESS);
}
@@ -356,7 +356,7 @@ isc_result_t omapi_unregister_io_object (omapi_object_t *h)
{
omapi_io_object_t *obj, *ph;
#if SOCKDELETE
- omapi_io_object_t *p, *last;
+ omapi_io_object_t *p, *last;
#endif
if (!h -> outer || h -> outer -> type != omapi_type_io_object)
@@ -440,7 +440,7 @@ isc_result_t omapi_wait_for_completion (omapi_object_t *object,
omapi_waiter_dereference (&waiter, MDL);
return status;
}
-
+
status = omapi_object_reference (&inner -> inner,
(omapi_object_t *)waiter,
MDL);
@@ -470,7 +470,7 @@ isc_result_t omapi_wait_for_completion (omapi_object_t *object,
}
if (waiter -> inner)
omapi_object_dereference (&waiter -> inner, MDL);
-
+
status = waiter -> waitstatus;
omapi_waiter_dereference (&waiter, MDL);
return status;
@@ -503,7 +503,7 @@ isc_result_t omapi_one_dispatch (omapi_object_t *wo,
if (now.tv_sec > t -> tv_sec ||
(now.tv_sec == t -> tv_sec && now.tv_usec >= t -> tv_usec))
return ISC_R_TIMEDOUT;
-
+
/* We didn't time out, so figure out how long until
we do. */
to.tv_sec = t -> tv_sec - now.tv_sec;
@@ -520,12 +520,12 @@ isc_result_t omapi_one_dispatch (omapi_object_t *wo,
if (to.tv_sec > (60 * 60 * 24))
to.tv_sec = 60 * 60 * 24;
}
-
+
/* If the object we're waiting on has reached completion,
return now. */
if (waiter && waiter -> ready)
return ISC_R_SUCCESS;
-
+
again:
/* If we have no I/O state, we can't proceed. */
if (!(io = omapi_io_states.next))
@@ -545,7 +545,7 @@ isc_result_t omapi_one_dispatch (omapi_object_t *wo,
if (desc > max)
max = desc;
}
-
+
/* Same deal for write fdets. */
if (io -> writefd && io -> inner &&
(desc = (*(io -> writefd)) (io -> inner)) >= 0) {
@@ -555,17 +555,17 @@ isc_result_t omapi_one_dispatch (omapi_object_t *wo,
}
}
- /* poll if all reader are dry */
+ /* poll if all reader are dry */
now.tv_sec = 0;
now.tv_usec = 0;
- rr=r;
- ww=w;
+ rr=r;
+ ww=w;
xx=x;
/* poll once */
count = select(max + 1, &r, &w, &x, &now);
- if (!count) {
- /* We are dry now */
+ if (!count) {
+ /* We are dry now */
trigger_event(&rw_queue_empty);
/* Wait for a packet or a timeout... XXX */
r = rr;
@@ -648,7 +648,7 @@ isc_result_t omapi_one_dispatch (omapi_object_t *wo,
goto again;
}
}
-
+
FD_ZERO (&r);
FD_ZERO (&w);
t0.tv_sec = t0.tv_usec = 0;
@@ -670,7 +670,7 @@ isc_result_t omapi_one_dispatch (omapi_object_t *wo,
}
if (prev)
omapi_io_dereference (&prev, MDL);
-
+
}
for (io = omapi_io_states.next; io; io = io -> next) {
@@ -684,7 +684,7 @@ isc_result_t omapi_one_dispatch (omapi_object_t *wo,
if (FD_ISSET (desc, &r))
((*(io -> reader)) (tmp));
}
-
+
/* Same deal for write descriptors. */
if (io -> writefd &&
(desc = (*(io -> writefd)) (tmp)) >= 0)
@@ -703,9 +703,9 @@ isc_result_t omapi_one_dispatch (omapi_object_t *wo,
omapi_io_reference(&io, omapi_io_states.next, MDL);
}
while (io != NULL) {
- if ((io->inner == NULL) ||
- ((io->reaper != NULL) &&
- ((io->reaper)(io->inner) != ISC_R_SUCCESS)))
+ if ((io->inner == NULL) ||
+ ((io->reaper != NULL) &&
+ ((io->reaper)(io->inner) != ISC_R_SUCCESS)))
{
omapi_io_object_t *tmp = NULL;
@@ -721,7 +721,7 @@ isc_result_t omapi_one_dispatch (omapi_object_t *wo,
omapi_io_reference(&prev->next,
tmp, MDL);
} else {
- omapi_io_dereference(&omapi_io_states.next,
+ omapi_io_dereference(&omapi_io_states.next,
MDL);
if (tmp != NULL)
omapi_io_reference
@@ -773,7 +773,7 @@ isc_result_t omapi_io_set_value (omapi_object_t *h,
{
if (h -> type != omapi_type_io_object)
return DHCP_R_INVALIDARG;
-
+
if (h -> inner && h -> inner -> type -> set_value)
return (*(h -> inner -> type -> set_value))
(h -> inner, id, name, value);
@@ -787,7 +787,7 @@ isc_result_t omapi_io_get_value (omapi_object_t *h,
{
if (h -> type != omapi_type_io_object)
return DHCP_R_INVALIDARG;
-
+
if (h -> inner && h -> inner -> type -> get_value)
return (*(h -> inner -> type -> get_value))
(h -> inner, id, name, value);
@@ -808,7 +808,7 @@ isc_result_t omapi_io_destroy (omapi_object_t *h, const char *file, int line)
if (h -> type != omapi_type_io_object)
return DHCP_R_INVALIDARG;
-
+
/* remove from the list of I/O states */
for (p = omapi_io_states.next; p; p = p -> next) {
if (p == (omapi_io_object_t *)h) {
@@ -839,7 +839,7 @@ isc_result_t omapi_io_signal_handler (omapi_object_t *h,
{
if (h -> type != omapi_type_io_object)
return DHCP_R_INVALIDARG;
-
+
if (h -> inner && h -> inner -> type -> signal_handler)
return (*(h -> inner -> type -> signal_handler)) (h -> inner,
name, ap);
@@ -866,7 +866,7 @@ isc_result_t omapi_waiter_signal_handler (omapi_object_t *h,
if (h -> type != omapi_type_waiter)
return DHCP_R_INVALIDARG;
-
+
if (!strcmp (name, "ready")) {
waiter = (omapi_waiter_object_t *)h;
waiter -> ready = 1;
diff --git a/omapip/generic.c b/omapip/generic.c
index af95d57a..87d10a23 100644
--- a/omapip/generic.c
+++ b/omapip/generic.c
@@ -98,7 +98,7 @@ isc_result_t omapi_generic_set_value (omapi_object_t *h,
/* Notice a free slot if we pass one. */
else if (vfree == -1 && !g -> values [i])
vfree = i;
- }
+ }
/* If the name isn't already attached to this object, see if an
inner object has it. */
@@ -176,7 +176,7 @@ isc_result_t omapi_generic_get_value (omapi_object_t *h,
if (h -> type != omapi_type_generic)
return DHCP_R_INVALIDARG;
g = (omapi_generic_object_t *)h;
-
+
/* Look up the specified name in our list of objects. */
for (i = 0; i < g -> nvalues; i++) {
if (!g -> values[i])
@@ -191,7 +191,7 @@ isc_result_t omapi_generic_get_value (omapi_object_t *h,
return omapi_value_reference (value,
g -> values [i], MDL);
}
- }
+ }
if (h -> inner && h -> inner -> type -> get_value)
return (*(h -> inner -> type -> get_value))
@@ -208,7 +208,7 @@ isc_result_t omapi_generic_destroy (omapi_object_t *h,
if (h -> type != omapi_type_generic)
return ISC_R_UNEXPECTED;
g = (omapi_generic_object_t *)h;
-
+
if (g -> values) {
for (i = 0; i < g -> nvalues; i++) {
if (g -> values [i])
@@ -230,7 +230,7 @@ isc_result_t omapi_generic_signal_handler (omapi_object_t *h,
{
if (h -> type != omapi_type_generic)
return DHCP_R_INVALIDARG;
-
+
if (h -> inner && h -> inner -> type -> signal_handler)
return (*(h -> inner -> type -> signal_handler)) (h -> inner,
name, ap);
@@ -251,7 +251,7 @@ isc_result_t omapi_generic_stuff_values (omapi_object_t *c,
if (g -> type != omapi_type_generic)
return DHCP_R_INVALIDARG;
src = (omapi_generic_object_t *)g;
-
+
for (i = 0; i < src -> nvalues; i++) {
if (src -> values [i] && src -> values [i] -> name -> len &&
src -> changed [i]) {
@@ -270,7 +270,7 @@ isc_result_t omapi_generic_stuff_values (omapi_object_t *c,
if (status != ISC_R_SUCCESS)
return status;
}
- }
+ }
if (g -> inner && g -> inner -> type -> stuff_values)
return (*(g -> inner -> type -> stuff_values)) (c, id,
diff --git a/omapip/handle.c b/omapip/handle.c
index aa368522..225104b2 100644
--- a/omapip/handle.c
+++ b/omapip/handle.c
@@ -47,7 +47,7 @@
next handle should go, and if necessary create additional nodes in
the tree to contain the new handle. The pointer to the object is
then stored in the correct position.
-
+
Theoretically, we could have some code here to free up handle
tables as they go out of use, but by and large handle tables won't
go out of use, so this is being skipped for now. It shouldn't be
@@ -77,7 +77,7 @@ isc_result_t omapi_object_handle (omapi_handle_t *h, omapi_object_t *o)
*h = o -> handle;
return ISC_R_SUCCESS;
}
-
+
if (!omapi_handle_table) {
omapi_handle_table = dmalloc (sizeof *omapi_handle_table, MDL);
if (!omapi_handle_table)
@@ -96,7 +96,7 @@ isc_result_t omapi_object_handle (omapi_handle_t *h, omapi_object_t *o)
while (omapi_next_handle >= omapi_handle_table -> limit) {
omapi_handle_table_t *new;
-
+
new = dmalloc (sizeof *new, MDL);
if (!new)
return ISC_R_NOMEMORY;
@@ -145,7 +145,7 @@ static isc_result_t omapi_object_handle_in_table (omapi_handle_t h,
if (table -> first > h || table -> limit <= h)
return ISC_R_NOSPACE;
-
+
/* If this is a leaf table, just stash the object in the
appropriate place. */
if (table -> leafp) {
@@ -249,7 +249,7 @@ static isc_result_t omapi_handle_lookup_in (omapi_object_t **o,
if (!table || table->first > h || table->limit <= h)
return(ISC_R_NOTFOUND);
-
+
/* If this is a leaf table, just grab the object. */
if (table->leafp) {
/* Not there? */
diff --git a/omapip/hash.c b/omapip/hash.c
index 9ca0a013..09a44167 100644
--- a/omapip/hash.c
+++ b/omapip/hash.c
@@ -149,7 +149,7 @@ void relinquish_hash_bucket_hunks ()
if (!n)
p = &c -> next;
}
-
+
for (c = hash_bucket_hunks; c; c = n) {
n = c -> next;
if (c -> len != 126) {
@@ -300,7 +300,7 @@ do_id_hash(const void *name, unsigned len, unsigned size)
* The switch handles our starting conditions, then we hash the
* remaining bytes in groups of 3
*/
-
+
switch (len % 3) {
case 0:
break;
@@ -386,7 +386,7 @@ hash_report(struct hash_table *table)
maxlen > 2147483647)
return (unsigned char *) "Report out of range for display.";
- sprintf((char *)retbuf,
+ sprintf((char *)retbuf,
"Contents/Size (%%): %u/%u (%u%%). Min/max: %u/%u",
contents, table->hash_count, pct, minlen, maxlen);
@@ -536,7 +536,7 @@ int casecmp (const void *v1, const void *v2, size_t len)
size_t i;
const unsigned char *s = v1;
const unsigned char *t = v2;
-
+
for (i = 0; i < len; i++)
{
int c1, c2;
diff --git a/omapip/isclib.c b/omapip/isclib.c
index f014bd8e..f726fb7e 100644
--- a/omapip/isclib.c
+++ b/omapip/isclib.c
@@ -40,7 +40,7 @@ int shutdown_signal = 0;
* It may be moved to be part of the dns client code instead
* of being in the DHCP code
*/
-isc_result_t
+isc_result_t
dhcp_dns_client_setservers(void)
{
isc_result_t result;
@@ -183,7 +183,7 @@ dhcp_context_create(int flags,
}
memset(&dhcp_gbl_ctx, 0, sizeof (dhcp_gbl_ctx));
-
+
isc_lib_register();
/* get the current time for use as the random seed */
@@ -318,7 +318,7 @@ dhcp_isc_name(unsigned char *namestr,
isc_buffer_t b;
isc_result_t result;
- namelen = strlen((char *)namestr);
+ namelen = strlen((char *)namestr);
isc_buffer_init(&b, namestr, namelen);
isc_buffer_add(&b, namelen);
dns_fixedname_init(namefix);
diff --git a/omapip/listener.c b/omapip/listener.c
index 828970ce..f7a07f09 100644
--- a/omapip/listener.c
+++ b/omapip/listener.c
@@ -181,7 +181,7 @@ isc_result_t omapi_listen_addr (omapi_object_t *h,
error_exit:
if (obj != NULL) {
if (h->outer == (omapi_object_t *)obj) {
- omapi_object_dereference((omapi_object_t **)&h->outer,
+ omapi_object_dereference((omapi_object_t **)&h->outer,
MDL);
}
if (obj->inner == h) {
@@ -205,7 +205,7 @@ int omapi_listener_readfd (omapi_object_t *h)
if (h -> type != omapi_type_listener)
return -1;
l = (omapi_listener_object_t *)h;
-
+
return l -> socket;
}
@@ -287,7 +287,7 @@ isc_result_t omapi_listener_connect (omapi_connection_object_t **obj,
#ifdef DEBUG_PROTOCOL
log_debug ("omapi_accept()");
#endif
-
+
/* Get the handle. */
status = omapi_connection_allocate (obj, MDL);
if (status != ISC_R_SUCCESS)
@@ -417,7 +417,7 @@ isc_result_t omapi_listener_set_value (omapi_object_t *h,
{
if (h -> type != omapi_type_listener)
return DHCP_R_INVALIDARG;
-
+
if (h -> inner && h -> inner -> type -> set_value)
return (*(h -> inner -> type -> set_value))
(h -> inner, id, name, value);
@@ -431,7 +431,7 @@ isc_result_t omapi_listener_get_value (omapi_object_t *h,
{
if (h -> type != omapi_type_listener)
return DHCP_R_INVALIDARG;
-
+
if (h -> inner && h -> inner -> type -> get_value)
return (*(h -> inner -> type -> get_value))
(h -> inner, id, name, value);
@@ -450,7 +450,7 @@ isc_result_t omapi_listener_destroy (omapi_object_t *h,
#ifdef DEBUG_PROTOCOL
log_debug ("omapi_listener_destroy()");
#endif
-
+
if (l -> socket != -1) {
close (l -> socket);
l -> socket = -1;
@@ -463,7 +463,7 @@ isc_result_t omapi_listener_signal_handler (omapi_object_t *h,
{
if (h -> type != omapi_type_listener)
return DHCP_R_INVALIDARG;
-
+
if (h -> inner && h -> inner -> type -> signal_handler)
return (*(h -> inner -> type -> signal_handler)) (h -> inner,
name, ap);
@@ -485,4 +485,3 @@ isc_result_t omapi_listener_stuff_values (omapi_object_t *c,
l -> inner);
return ISC_R_SUCCESS;
}
-
diff --git a/omapip/message.c b/omapip/message.c
index 254061a0..42b88b6d 100644
--- a/omapip/message.c
+++ b/omapip/message.c
@@ -158,7 +158,7 @@ isc_result_t omapi_message_set_value (omapi_object_t *h,
if (status == ISC_R_SUCCESS)
return status;
}
-
+
return ISC_R_NOTFOUND;
}
@@ -232,7 +232,7 @@ isc_result_t omapi_message_signal_handler (omapi_object_t *h,
if (h -> type != omapi_type_message)
return DHCP_R_INVALIDARG;
m = (omapi_message_object_t *)h;
-
+
if (!strcmp (name, "status")) {
if (m -> notify_object &&
m -> notify_object -> type -> signal_handler)
@@ -271,7 +271,7 @@ isc_result_t omapi_message_register (omapi_object_t *mo)
if (mo -> type != omapi_type_message)
return DHCP_R_INVALIDARG;
m = (omapi_message_object_t *)mo;
-
+
/* Already registered? */
if (m -> prev || m -> next || omapi_registered_messages == m)
return DHCP_R_INVALIDARG;
@@ -300,7 +300,7 @@ isc_result_t omapi_message_unregister (omapi_object_t *mo)
if (mo -> type != omapi_type_message)
return DHCP_R_INVALIDARG;
m = (omapi_message_object_t *)mo;
-
+
/* Not registered? */
if (!m -> prev && omapi_registered_messages != m)
return DHCP_R_INVALIDARG;
@@ -550,7 +550,7 @@ omapi_message_process_internal (omapi_object_t *mo, omapi_object_t *po)
(po, message -> id_object,
ISC_R_NOTFOUND, message -> id,
"no object matches specification");
- }
+ }
/* If we found an object, we're supposed to be creating an
object, and we're not supposed to have found an object,
@@ -622,7 +622,7 @@ omapi_message_process_internal (omapi_object_t *mo, omapi_object_t *po)
"can't select authenticator");
}
}
-
+
/* Now send the new contents of the object back in
response. */
goto send;
@@ -636,7 +636,7 @@ omapi_message_process_internal (omapi_object_t *mo, omapi_object_t *po)
status, message -> id,
"no matching handle");
}
- send:
+ send:
status = omapi_protocol_send_update (po, message -> id_object,
message -> id, object);
omapi_object_dereference (&object, MDL);
@@ -666,7 +666,7 @@ omapi_message_process_internal (omapi_object_t *mo, omapi_object_t *po)
status, message -> id,
"cannot update authenticator");
}
-
+
status = omapi_protocol_add_auth (po, object,
message -> h);
} else {
diff --git a/omapip/omapi.3 b/omapip/omapi.3
index d5de2a61..5edf6275 100644
--- a/omapip/omapi.3
+++ b/omapip/omapi.3
@@ -49,7 +49,7 @@ act as surrogates for the real objects in the server. For example a
client will create a handle for a lease object, and will request the
server to fill the lease handle's state. The client application can
then pull details such as the lease expiration time from the lease
-handle.
+handle.
.PP
Modifications can be made to the server state by creating handles to
new objects, or by modifying attributes of handles to existing
@@ -58,8 +58,8 @@ the changes made.
.SH USAGE
.PP
The client application must always call dhcpctl_initialize() before
-making calls to any other dhcpctl functions. This initializes
-various internal data structures.
+making calls to any other dhcpctl functions. This initializes
+various internal data structures.
.PP
To create the connection to the server the client must use
dhcpctl_connect() function. As well as making the physical connection
@@ -194,7 +194,7 @@ Get the attribute named ``ends'' from the lease handle. This is a
will expire.
.PP
.nf
-
+
memcpy(&thetime, value->value, value->len);
dhcpctl_data_string_dereference(&value, MDL);
@@ -213,7 +213,7 @@ the connection the user must call dhcpctl_new_authenticator.
const char *algorithm = "hmac-md5";
const char *secret = "a-shared-secret";
- dhcpctl_new_authenticator (&authenticator,
+ dhcpctl_new_authenticator (&authenticator,
keyname,
algorithm,
secret,
@@ -246,4 +246,3 @@ dhcpctl(3), omshell(1), dhcpd(8), dhclient(8), dhcpd.conf(5), dhclient.conf(5).
is maintained by ISC. To learn more about Internet Systems Consortium,
see
.B https://www.isc.org
-
diff --git a/omapip/protocol.c b/omapip/protocol.c
index ea93d0f1..f259a291 100644
--- a/omapip/protocol.c
+++ b/omapip/protocol.c
@@ -338,7 +338,7 @@ isc_result_t omapi_protocol_send_message (omapi_object_t *po,
}
return ISC_R_SUCCESS;
}
-
+
isc_result_t omapi_protocol_signal_handler (omapi_object_t *h,
const char *name, va_list ap)
@@ -439,7 +439,7 @@ isc_result_t omapi_protocol_signal_handler (omapi_object_t *h,
byte order. */
omapi_connection_get_uint32 (c, &p -> protocol_version);
omapi_connection_get_uint32 (c, &p -> header_size);
-
+
/* We currently only support the current protocol version. */
if (p -> protocol_version != OMAPI_PROTOCOL_VERSION) {
omapi_disconnect (c, 1);
@@ -538,7 +538,7 @@ isc_result_t omapi_protocol_signal_handler (omapi_object_t *h,
(0, c, (p -> header_size -
sizeof (omapi_protocol_header_t)));
}
-
+
/* XXX must compute partial signature across the
XXX preceding bytes. Also, if authenticator
specifies encryption as well as signing, we may
@@ -602,7 +602,7 @@ isc_result_t omapi_protocol_signal_handler (omapi_object_t *h,
if (omapi_connection_require (c, nlen) != ISC_R_SUCCESS)
break;
/* If it's already here, fall through. */
-
+
case omapi_protocol_name_wait:
omapi_connection_copyout (p -> name -> value, c,
p -> name -> len);
@@ -633,7 +633,7 @@ isc_result_t omapi_protocol_signal_handler (omapi_object_t *h,
if (omapi_connection_require (c, vlen) != ISC_R_SUCCESS)
break;
/* If it's already here, fall through. */
-
+
case omapi_protocol_value_wait:
omapi_connection_copyout (p -> value -> u.buffer.value, c,
p -> value -> u.buffer.len);
@@ -697,7 +697,7 @@ isc_result_t omapi_protocol_signal_handler (omapi_object_t *h,
&p -> message -> authenticator,
omapi_datatype_data,
p -> message -> authlen);
-
+
if (status != ISC_R_SUCCESS) {
if (signature != NULL) {
omapi_value_dereference (&signature, MDL);
@@ -756,7 +756,7 @@ isc_result_t omapi_protocol_signal_handler (omapi_object_t *h,
previous_outstanding = 0xDEADBEEF;
#endif
/* Now wait for the next message. */
- goto to_header_wait;
+ goto to_header_wait;
default:
/* XXX should never get here. Assertion? */
@@ -899,7 +899,7 @@ isc_result_t omapi_protocol_get_value (omapi_object_t *h,
return omapi_make_object_value (value, name,
p -> default_auth -> a, MDL);
}
-
+
if (h -> inner && h -> inner -> type -> get_value)
return (*(h -> inner -> type -> get_value))
(h -> inner, id, name, value);
@@ -989,7 +989,7 @@ isc_result_t omapi_protocol_configure_security (omapi_object_t *h,
return DHCP_R_INVALIDARG;
}
}
-
+
/* Set up a listener for the omapi protocol. The handle stored points to
a listener object, not a protocol object. */
@@ -1092,7 +1092,7 @@ isc_result_t omapi_protocol_listener_set_value (omapi_object_t *h,
{
if (h -> type != omapi_type_protocol_listener)
return DHCP_R_INVALIDARG;
-
+
if (h -> inner && h -> inner -> type -> set_value)
return (*(h -> inner -> type -> set_value))
(h -> inner, id, name, value);
@@ -1106,7 +1106,7 @@ isc_result_t omapi_protocol_listener_get_value (omapi_object_t *h,
{
if (h -> type != omapi_type_protocol_listener)
return DHCP_R_INVALIDARG;
-
+
if (h -> inner && h -> inner -> type -> get_value)
return (*(h -> inner -> type -> get_value))
(h -> inner, id, name, value);
@@ -1298,8 +1298,8 @@ isc_result_t omapi_protocol_send_update (omapi_object_t *po,
omapi_message_dereference (&message, MDL);
return status;
}
- }
-
+ }
+
status = omapi_set_object_value (mo, (omapi_object_t *)0,
"object", object);
if (status != ISC_R_SUCCESS) {
diff --git a/omapip/result.c b/omapip/result.c
index c6e467bc..901be3c9 100644
--- a/omapip/result.c
+++ b/omapip/result.c
@@ -1,7 +1,7 @@
/* result.c
*/
-/*
+/*
* Copyright (c) 2004-2017 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1999-2003 by Internet Software Consortium
*
diff --git a/omapip/support.c b/omapip/support.c
index 6ad625a3..f3791de0 100644
--- a/omapip/support.c
+++ b/omapip/support.c
@@ -745,18 +745,18 @@ isc_result_t omapi_make_object_value (omapi_value_t **vp,
const char *file, int line)
{
isc_result_t status;
-
+
status = omapi_value_new (vp, file, line);
if (status != ISC_R_SUCCESS)
return status;
-
+
status = omapi_data_string_reference (&(*vp) -> name,
name, file, line);
if (status != ISC_R_SUCCESS) {
omapi_value_dereference (vp, file, line);
return status;
}
-
+
if (value) {
status = omapi_typed_data_new (file, line, &(*vp) -> value,
omapi_datatype_object, value);
@@ -765,7 +765,7 @@ isc_result_t omapi_make_object_value (omapi_value_t **vp,
return status;
}
}
-
+
return ISC_R_SUCCESS;
}
diff --git a/omapip/trace.c b/omapip/trace.c
index 4fa6397c..2a1527d6 100644
--- a/omapip/trace.c
+++ b/omapip/trace.c
@@ -157,7 +157,7 @@ isc_result_t trace_begin (const char *filename,
tfh.version = htonl (TRACEFILE_VERSION);
tfh.hlen = htonl (sizeof (tracefile_header_t));
tfh.phlen = htonl (sizeof (tracepacket_t));
-
+
status = write (traceoutfile, &tfh, sizeof tfh);
if (status < 0) {
log_error ("%s(%d): trace_begin write failed: %m", file, line);
@@ -184,7 +184,7 @@ isc_result_t trace_begin (const char *filename,
}
}
}
-
+
return ISC_R_SUCCESS;
}
@@ -222,7 +222,7 @@ isc_result_t trace_write_packet_iov (trace_type_t *ttype,
file ? file : "<unknown file>", line);
return DHCP_R_INVALIDARG;
}
-
+
/* Compute the total length of the iov. */
length = 0;
for (i = 0; i < count; i++)
@@ -266,7 +266,7 @@ isc_result_t trace_write_packet_iov (trace_type_t *ttype,
if (length % 8) {
static char zero [] = { 0, 0, 0, 0, 0, 0, 0 };
unsigned padl = 8 - (length % 8);
-
+
status = write (traceoutfile, zero, padl);
if (status < 0) {
log_error ("%s(%d): trace_write_packet write failed: %m",
@@ -330,7 +330,7 @@ trace_type_t *trace_type_register (const char *name,
strcpy (ttmp -> name, name);
ttmp -> have_packet = have_packet;
ttmp -> stop_tracing = stop_tracing;
-
+
if (traceoutfile) {
status = trace_type_record (ttmp, slen, file, line);
if (status != ISC_R_SUCCESS) {
@@ -345,7 +345,7 @@ trace_type_t *trace_type_register (const char *name,
return ttmp;
}
-
+
static isc_result_t trace_type_record (trace_type_t *ttmp, unsigned slen,
const char *file, int line)
{
@@ -403,7 +403,7 @@ void trace_index_map_input (trace_type_t *ttype, unsigned length, char *buf)
}
prev = &tptr -> next;
}
-
+
log_error ("No registered trace type for type name %.*s",
(int)length - TRACE_INDEX_MAPPING_SIZE, tmap -> name);
return;
@@ -544,7 +544,7 @@ isc_result_t trace_get_next_packet (trace_type_t **ttp,
tpkt->type_index = ntohl(tpkt -> type_index);
tpkt->length = ntohl(tpkt -> length);
tpkt->when = ntohl(tpkt -> when);
-
+
/* See if there's a handler for this packet type. */
if (tpkt->type_index < trace_type_count &&
trace_types[tpkt->type_index])
@@ -575,7 +575,7 @@ isc_result_t trace_get_next_packet (trace_type_t **ttp,
"tracefile");
return DHCP_R_PROTOCOLERROR;
}
-
+
status = fsetpos(traceinfile, &curpos);
if (status < 0) {
log_error("fsetpos in tracefile failed: %m");