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_pdu.c b/isisd/isis_pdu.c
index b6a035e..6dcc75e 100644
--- a/isisd/isis_pdu.c
+++ b/isisd/isis_pdu.c
@@ -1938,7 +1938,7 @@
hello_hdr.hold_time = htons ((u_int16_t) interval);
hello_hdr.pdu_len = 0; /* Update the PDU Length later */
- len_pointer = stream_get_putp (circuit->snd_stream) + 3 + ISIS_SYS_ID_LEN;
+ len_pointer = stream_get_endp (circuit->snd_stream) + 3 + ISIS_SYS_ID_LEN;
/* copy the shared part of the hello to the p2p hello if needed */
if (circuit->circ_type == CIRCUIT_T_P2P)
@@ -2012,7 +2012,7 @@
if (tlv_add_padding (circuit->snd_stream))
return ISIS_WARNING;
- length = stream_get_putp (circuit->snd_stream);
+ length = stream_get_endp (circuit->snd_stream);
/* Update PDU length */
stream_putw_at (circuit->snd_stream, len_pointer, (u_int16_t) length);
@@ -2132,7 +2132,7 @@
* Fill Level 1 or 2 Complete Sequence Numbers header
*/
- lenp = stream_get_putp (circuit->snd_stream);
+ lenp = stream_get_endp (circuit->snd_stream);
stream_putw (circuit->snd_stream, 0); /* PDU length - when we know it */
/* no need to send the source here, it is always us if we csnp */
stream_put (circuit->snd_stream, isis->sysid, ISIS_SYS_ID_LEN);
@@ -2159,7 +2159,7 @@
{
retval = tlv_add_lsp_entries (lsps, circuit->snd_stream);
}
- length = (u_int16_t) stream_get_putp (circuit->snd_stream);
+ length = (u_int16_t) stream_get_endp (circuit->snd_stream);
assert (length >= ISIS_CSNP_HDRLEN);
/* Update PU length */
stream_putw_at (circuit->snd_stream, lenp, length);
@@ -2287,7 +2287,7 @@
/*
* Fill Level 1 or 2 Partial Sequence Numbers header
*/
- lenp = stream_get_putp (circuit->snd_stream);
+ lenp = stream_get_endp (circuit->snd_stream);
stream_putw (circuit->snd_stream, 0); /* PDU length - when we know it */
stream_put (circuit->snd_stream, isis->sysid, ISIS_SYS_ID_LEN);
stream_putc (circuit->snd_stream, circuit->idx);
@@ -2325,7 +2325,7 @@
}
}
- length = (u_int16_t) stream_get_putp (circuit->snd_stream);
+ length = (u_int16_t) stream_get_endp (circuit->snd_stream);
assert (length >= ISIS_PSNP_HDRLEN);
/* Update PDU length */
stream_putw_at (circuit->snd_stream, lenp, length);
@@ -2446,7 +2446,7 @@
unsigned long length;
stream_put (stream, lsp->pdu, ntohs (lsp->lsp_header->pdu_len));
- length = stream_get_putp (stream);
+ length = stream_get_endp (stream);
return;
} */
@@ -2501,7 +2501,6 @@
}
/* copy our lsp to the send buffer */
circuit->snd_stream->getp = lsp->pdu->getp;
- circuit->snd_stream->putp = lsp->pdu->putp;
circuit->snd_stream->endp = lsp->pdu->endp;
memcpy (circuit->snd_stream->data, lsp->pdu->data, lsp->pdu->endp);
@@ -2577,7 +2576,7 @@
circuit->snd_stream);
- lenp = stream_get_putp (circuit->snd_stream);
+ lenp = stream_get_endp (circuit->snd_stream);
stream_putw (circuit->snd_stream, 0); /* PDU length */
stream_put (circuit->snd_stream, isis->sysid, ISIS_SYS_ID_LEN);
stream_putc (circuit->snd_stream, circuit->idx);
@@ -2589,7 +2588,7 @@
stream_putl (circuit->snd_stream, ntohl (hdr->seq_num));
stream_putw (circuit->snd_stream, ntohs (hdr->checksum));
- length = (u_int16_t) stream_get_putp (circuit->snd_stream);
+ length = (u_int16_t) stream_get_endp (circuit->snd_stream);
/* Update PDU length */
stream_putw_at (circuit->snd_stream, lenp, length);