summaryrefslogtreecommitdiffstats
path: root/ospfd/ospfd.h
diff options
context:
space:
mode:
authorajs <ajs>2005-02-23 15:43:01 +0000
committerajs <ajs>2005-02-23 15:43:01 +0000
commit436247ef2af85b4b8b5a2c469183e60f5963ff61 (patch)
tree630fb08727df9feb3f412c0d563cf0b23bb12452 /ospfd/ospfd.h
parent2574a76ad65eab9900728c4c6b301164cf318a62 (diff)
downloadquagga-436247ef2af85b4b8b5a2c469183e60f5963ff61.tar.bz2
quagga-436247ef2af85b4b8b5a2c469183e60f5963ff61.tar.xz
2005-02-23 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
* ospfd.h: Add new field struct stream *ibuf to struct ospf. * ospfd.c: (ospf_new) Check return code from ospf_sock_init. Allocate ibuf using stream_new(OSPF_MAX_PACKET_SIZE+1). (ospf_finish) Call stream_free(ospf->ibuf. * ospf_packet.c: (ospf_read) Call stream_reset(ospf->ibuf) and then pass it to ospf_recv_packet for use in receiving the packet (instead of allocating a new stream for each packet received). Eliminate all calls to stream_free(ibuf). (ospf_recv_packet) The struct stream *ibuf is now passed in as an argument. No need to use recvfrom to peek at the packet header (to see how big it is), just use ospf->ibuf which is always large enough (this eliminates a system call to recvfrom). Therefore, no need to allocate a stream just for this packet, and no need to free it when done.
Diffstat (limited to 'ospfd/ospfd.h')
-rw-r--r--ospfd/ospfd.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/ospfd/ospfd.h b/ospfd/ospfd.h
index 0f778e0d..2a6c23e9 100644
--- a/ospfd/ospfd.h
+++ b/ospfd/ospfd.h
@@ -248,6 +248,7 @@ struct ospf
struct thread *t_write;
struct thread *t_read;
int fd;
+ struct stream *ibuf;
struct list *oi_write_q;
/* Distribute lists out of other route sources. */