2005-02-09 Paul Jakma <paul.jakma@sun.com>
* (global) Update code to match stream.h changes.
stream_get_putp effectively replaced with stream_get_endp.
stream_forward renamed to stream_forward_getp.
stream_forward_endp introduced to replace some previous
setting/manual twiddling of putp by daemons.
* lib/stream.h: Remove putp. Update reference to putp with endp.
Add stream_forward_endp, which daemons were doing manually.
Rename stream_forward to stream_forward_getp.
lib/stream.c: Remove/update references to putp.
introduce stream_forward_endp.
diff --git a/isisd/isis_network.c b/isisd/isis_network.c
index a0df32e..2e901f1 100644
--- a/isisd/isis_network.c
+++ b/isisd/isis_network.c
@@ -422,7 +422,6 @@
/* then we lose the LLC */
memcpy (STREAM_DATA (circuit->rcv_stream),
sock_buff + LLC_LEN, bytesread - LLC_LEN);
- circuit->rcv_stream->putp = bytesread - LLC_LEN;
circuit->rcv_stream->endp = bytesread - LLC_LEN;
memcpy (ssnpa, &s_addr.sll_addr, s_addr.sll_halen);
@@ -453,7 +452,6 @@
return ISIS_WARNING;
}
- circuit->rcv_stream->putp = bytesread;
circuit->rcv_stream->endp = bytesread;
/* If we don't have protocol type 0x00FE which is
@@ -503,7 +501,7 @@
/* now we can send this */
written = sendto (circuit->fd, sock_buff,
- circuit->snd_stream->putp + LLC_LEN, 0,
+ stream_get_endp(circuit->snd_stream) + LLC_LEN, 0,
(struct sockaddr *) &sa, sizeof (struct sockaddr_ll));
return ISIS_OK;
@@ -531,7 +529,8 @@
/* lets try correcting the protocol */
sa.sll_protocol = htons (0x00FE);
written = sendto (circuit->fd, circuit->snd_stream->data,
- circuit->snd_stream->putp, 0, (struct sockaddr *) &sa,
+ stream_get_endp (circuit->snd_stream), 0,
+ (struct sockaddr *) &sa,
sizeof (struct sockaddr_ll));
return ISIS_OK;
@@ -576,7 +575,6 @@
memcpy (STREAM_DATA (circuit->rcv_stream),
readbuff + offset, bpf_hdr->bh_caplen - LLC_LEN - ETHER_HDR_LEN);
- circuit->rcv_stream->putp = bpf_hdr->bh_caplen - LLC_LEN - ETHER_HDR_LEN;
circuit->rcv_stream->endp = bpf_hdr->bh_caplen - LLC_LEN - ETHER_HDR_LEN;
circuit->rcv_stream->getp = 0;
@@ -603,7 +601,6 @@
return ISIS_WARNING;
}
- circuit->rcv_stream->putp = bytesread;
circuit->rcv_stream->endp = bytesread;
return ISIS_OK;
@@ -641,7 +638,8 @@
/* now we can send this */
written = write (circuit->fd, sock_buff,
- circuit->snd_stream->putp + LLC_LEN + ETHER_HDR_LEN);
+ stream_get_endp (circuit->snd_stream)
+ + LLC_LEN + ETHER_HDR_LEN);
return ISIS_OK;
}