summaryrefslogtreecommitdiff
path: root/usr.sbin/ospf6d/lsupdate.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/ospf6d/lsupdate.c')
-rw-r--r--usr.sbin/ospf6d/lsupdate.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/usr.sbin/ospf6d/lsupdate.c b/usr.sbin/ospf6d/lsupdate.c
index c4dbb6b05b6..558b684a2ea 100644
--- a/usr.sbin/ospf6d/lsupdate.c
+++ b/usr.sbin/ospf6d/lsupdate.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lsupdate.c,v 1.4 2009/06/06 09:02:46 eric Exp $ */
+/* $OpenBSD: lsupdate.c,v 1.5 2010/05/26 13:56:08 nicm Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -35,9 +35,9 @@
extern struct ospfd_conf *oeconf;
extern struct imsgev *iev_rde;
-struct buf *prepare_ls_update(struct iface *);
-int add_ls_update(struct buf *, struct iface *, void *, int, u_int16_t);
-int send_ls_update(struct buf *, struct iface *, struct in6_addr, u_int32_t);
+struct ibuf *prepare_ls_update(struct iface *);
+int add_ls_update(struct ibuf *, struct iface *, void *, int, u_int16_t);
+int send_ls_update(struct ibuf *, struct iface *, struct in6_addr, u_int32_t);
void ls_retrans_list_insert(struct nbr *, struct lsa_entry *);
void ls_retrans_list_remove(struct nbr *, struct lsa_entry *);
@@ -146,12 +146,12 @@ lsa_flood(struct iface *iface, struct nbr *originator, struct lsa_hdr *lsa_hdr,
return (dont_ack == 2);
}
-struct buf *
+struct ibuf *
prepare_ls_update(struct iface *iface)
{
- struct buf *buf;
+ struct ibuf *buf;
- if ((buf = buf_open(iface->mtu - sizeof(struct ip))) == NULL)
+ if ((buf = ibuf_open(iface->mtu - sizeof(struct ip))) == NULL)
fatal("prepare_ls_update");
/* OSPF header */
@@ -159,18 +159,18 @@ prepare_ls_update(struct iface *iface)
goto fail;
/* reserve space for number of lsa field */
- if (buf_reserve(buf, sizeof(u_int32_t)) == NULL)
+ if (ibuf_reserve(buf, sizeof(u_int32_t)) == NULL)
goto fail;
return (buf);
fail:
log_warn("prepare_ls_update");
- buf_free(buf);
+ ibuf_free(buf);
return (NULL);
}
int
-add_ls_update(struct buf *buf, struct iface *iface, void *data, int len,
+add_ls_update(struct ibuf *buf, struct iface *iface, void *data, int len,
u_int16_t older)
{
size_t pos;
@@ -180,7 +180,7 @@ add_ls_update(struct buf *buf, struct iface *iface, void *data, int len,
return (0);
pos = buf->wpos;
- if (buf_add(buf, data, len)) {
+ if (ibuf_add(buf, data, len)) {
log_warn("add_ls_update");
return (0);
}
@@ -191,19 +191,19 @@ add_ls_update(struct buf *buf, struct iface *iface, void *data, int len,
if ((age += older + iface->transmit_delay) >= MAX_AGE)
age = MAX_AGE;
age = htons(age);
- memcpy(buf_seek(buf, pos, sizeof(age)), &age, sizeof(age));
+ memcpy(ibuf_seek(buf, pos, sizeof(age)), &age, sizeof(age));
return (1);
}
int
-send_ls_update(struct buf *buf, struct iface *iface, struct in6_addr addr,
+send_ls_update(struct ibuf *buf, struct iface *iface, struct in6_addr addr,
u_int32_t nlsa)
{
int ret;
nlsa = htonl(nlsa);
- memcpy(buf_seek(buf, sizeof(struct ospf_hdr), sizeof(nlsa)),
+ memcpy(ibuf_seek(buf, sizeof(struct ospf_hdr), sizeof(nlsa)),
&nlsa, sizeof(nlsa));
/* calculate checksum */
if (upd_ospf_hdr(buf, iface))
@@ -211,11 +211,11 @@ send_ls_update(struct buf *buf, struct iface *iface, struct in6_addr addr,
ret = send_packet(iface, buf->buf, buf->wpos, &addr);
- buf_free(buf);
+ ibuf_free(buf);
return (ret);
fail:
log_warn("send_ls_update");
- buf_free(buf);
+ ibuf_free(buf);
return (-1);
}
@@ -416,7 +416,7 @@ ls_retrans_timer(int fd, short event, void *bula)
struct in6_addr addr;
struct nbr *nbr = bula;
struct lsa_entry *le;
- struct buf *buf;
+ struct ibuf *buf;
time_t now;
int d;
u_int32_t nlsa = 0;