summaryrefslogtreecommitdiff
path: root/sbin/photurisd/schedule.c
diff options
context:
space:
mode:
authorNiels Provos <provos@cvs.openbsd.org>2000-12-11 21:21:19 +0000
committerNiels Provos <provos@cvs.openbsd.org>2000-12-11 21:21:19 +0000
commit7c0703b2a547d65ce1921ec3adeb6cb277f5f35a (patch)
treeee72ca9953ddcde25be632639bb3242cac086577 /sbin/photurisd/schedule.c
parentcd40f5ad40cd4912648f1cb155bf3167202ddc89 (diff)
proper logging.
Diffstat (limited to 'sbin/photurisd/schedule.c')
-rw-r--r--sbin/photurisd/schedule.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/sbin/photurisd/schedule.c b/sbin/photurisd/schedule.c
index 7bbb95d6d64..c33e360ff34 100644
--- a/sbin/photurisd/schedule.c
+++ b/sbin/photurisd/schedule.c
@@ -35,7 +35,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: schedule.c,v 1.1 1998/11/14 23:37:28 deraadt Exp $";
+static char rcsid[] = "$Id: schedule.c,v 1.2 2000/12/11 21:21:18 provos Exp $";
#endif
#define _SCHEDULE_C_
@@ -55,7 +55,7 @@ static char rcsid[] = "$Id: schedule.c,v 1.1 1998/11/14 23:37:28 deraadt Exp $";
#include "buffer.h"
#include "schedule.h"
#include "secrets.h"
-#include "errlog.h"
+#include "log.h"
#include "cookie.h"
#include "modulus.h"
#include "api.h"
@@ -86,7 +86,7 @@ schedule_insert(int type, int off, u_int8_t *cookie, u_int16_t cookie_size)
#endif
if ((tmp = calloc(1, sizeof(struct schedule))) == NULL) {
- log_error(1, "calloc() in schedule_insert()");
+ log_error("calloc() in schedule_insert()");
return;
}
@@ -97,7 +97,7 @@ schedule_insert(int type, int off, u_int8_t *cookie, u_int16_t cookie_size)
if (cookie != NULL) {
tmp->cookie = calloc(cookie_size, sizeof(u_int8_t));
if (tmp->cookie == NULL) {
- log_error(1, "calloc() in schedule_insert()");
+ log_error("calloc() in schedule_insert()");
free(tmp);
return;
}
@@ -232,7 +232,7 @@ schedule_process(int sock)
} else if (st->retries >= max_retries) {
remove = 1;
if (st->phase == COOKIE_REQUEST && st->resource == 0) {
- log_error(0, "no anwser for cookie request to %s:%d",
+ log_print("no anwser for cookie request to %s:%d",
st->address, st->port);
#ifdef IPSEC
if (st->flags & IPSEC_NOTIFY)
@@ -243,7 +243,7 @@ schedule_process(int sock)
/* Try again with updated counters */
struct stateob *newst;
if ((newst = state_new()) == NULL) {
- log_error(1, "state_new() in schedule_process()");
+ log_error("state_new() in schedule_process()");
break;
}
state_copy_flags(st, newst);
@@ -255,7 +255,7 @@ schedule_process(int sock)
state_insert(newst);
break;
} else {
- log_error(0, "exchange terminated, phase %d to %s:%d",
+ log_print("exchange terminated, phase %d to %s:%d",
st->phase, st->address, st->port);
break;
}
@@ -263,7 +263,7 @@ schedule_process(int sock)
if (st->packet == NULL || st->packetlen == 0) {
- log_error(0, "no packet in schedule_process()");
+ log_print("no packet in schedule_process()");
remove = 1;
break;
}
@@ -279,7 +279,7 @@ schedule_process(int sock)
if (sendto(sock, st->packet, st->packetlen, 0,
(struct sockaddr *) &sin, sizeof(sin))
!= st->packetlen) {
- log_error(1, "sendto() in schedule_process()");
+ log_error("sendto() in schedule_process()");
remove = 1;
break;
}
@@ -302,7 +302,7 @@ schedule_process(int sock)
remove = 1;
/* We are to create a new SPI */
if ((spi = spi_find(NULL, tmp->cookie)) == NULL) {
- log_error(0, "spi_find() in schedule_process()");
+ log_print("spi_find() in schedule_process()");
break;
}
if ((st = state_find_cookies(spi->address, spi->icookie, NULL)) == NULL) {
@@ -311,7 +311,7 @@ schedule_process(int sock)
* This happens always when an exchange expires but
* updates are still scheduled for it.
*/
- log_error(0, "state_find_cookies() in schedule_process()");
+ log_print("state_find_cookies() in schedule_process()");
#endif
break;
}
@@ -319,7 +319,7 @@ schedule_process(int sock)
if (st->oSPIattrib != NULL)
free(st->oSPIattrib);
if ((st->oSPIattrib = calloc(spi->attribsize, sizeof(u_int8_t))) == NULL) {
- log_error(1, "calloc() in schedule_process()");
+ log_error("calloc() in schedule_process()");
break;
}
st->oSPIattribsize = spi->attribsize;
@@ -328,13 +328,13 @@ schedule_process(int sock)
/* We can keep our old attributes, this is only an update */
if (make_spi(st, spi->local_address, st->oSPI, &(st->olifetime),
&(st->oSPIattrib), &(st->oSPIattribsize)) == -1) {
- log_error(0, "make_spi() in schedule_process()");
+ log_print("make_spi() in schedule_process()");
break;
}
packet_size = PACKET_BUFFER_SIZE;
if (photuris_spi_update(st, packet_buffer, &packet_size) == -1) {
- log_error(0, "photuris_spi_update() in schedule_process()");
+ log_print("photuris_spi_update() in schedule_process()");
break;
}
@@ -345,7 +345,7 @@ schedule_process(int sock)
if (sendto(sock, packet_buffer, packet_size, 0,
(struct sockaddr *) &sin, sizeof(sin)) != packet_size) {
- log_error(1, "sendto() in schedule_process()");
+ log_error("sendto() in schedule_process()");
break;
}
@@ -354,11 +354,11 @@ schedule_process(int sock)
#endif
/* Insert Owner SPI */
if ((nspi = spi_new(st->address, st->oSPI)) == NULL) {
- log_error(1, "spi_new() in handle_spi_needed()");
+ log_error("spi_new() in handle_spi_needed()");
break;
}
if ((nspi->local_address = strdup(spi->local_address)) == NULL) {
- log_error(1, "strdup() in handle_spi_needed()");
+ log_error("strdup() in handle_spi_needed()");
spi_value_reset(nspi);
break;
}
@@ -367,7 +367,7 @@ schedule_process(int sock)
nspi->attribsize = st->oSPIattribsize;
nspi->attributes = calloc(nspi->attribsize, sizeof(u_int8_t));
if (nspi->attributes == NULL) {
- log_error(1, "calloc() in handle_spi_needed()");
+ log_error("calloc() in handle_spi_needed()");
spi_value_reset(nspi);
break;
}
@@ -384,7 +384,7 @@ schedule_process(int sock)
break;
default:
remove = 1;
- log_error(0, "Unknown event in schedule_process()");
+ log_print("Unknown event in schedule_process()");
break;
}