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_lsp.c b/isisd/isis_lsp.c
index 8dae147..52d8884 100644
--- a/isisd/isis_lsp.c
+++ b/isisd/isis_lsp.c
@@ -369,7 +369,6 @@
/* copying only the relevant part of our stream */
lsp->pdu = stream_new (stream->endp);
- lsp->pdu->putp = stream->putp;
lsp->pdu->getp = stream->getp;
lsp->pdu->endp = stream->endp;
memcpy (lsp->pdu->data, stream->data, stream->endp);
@@ -509,7 +508,7 @@
lsp->level = level;
lsp->age_out = ZERO_AGE_LIFETIME;
- stream_set_putp (lsp->pdu, ISIS_FIXED_HDR_LEN + ISIS_LSP_HDR_LEN);
+ stream_forward_endp (lsp->pdu, ISIS_FIXED_HDR_LEN + ISIS_LSP_HDR_LEN);
/* #ifdef EXTREME_DEBUG */
/* logging */
@@ -1141,7 +1140,7 @@
}
}
- stream_set_putp (lsp->pdu, ISIS_FIXED_HDR_LEN + ISIS_LSP_HDR_LEN);
+ stream_forward_endp (lsp->pdu, ISIS_FIXED_HDR_LEN + ISIS_LSP_HDR_LEN);
if (lsp->tlv_data.nlpids)
tlv_add_nlpid (lsp->tlv_data.nlpids, lsp->pdu);
@@ -1159,7 +1158,7 @@
tlv_add_ipv6_reachs (lsp->tlv_data.ipv6_reachs, lsp->pdu);
#endif /* HAVE_IPV6 */
- lsp->lsp_header->pdu_len = htons (stream_get_putp (lsp->pdu));
+ lsp->lsp_header->pdu_len = htons (stream_get_endp (lsp->pdu));
return;
}
@@ -1200,7 +1199,7 @@
}
tlv_build_func (*to, lsp->pdu);
}
- lsp->lsp_header->pdu_len = htons (stream_get_putp (lsp->pdu));
+ lsp->lsp_header->pdu_len = htons (stream_get_endp (lsp->pdu));
return;
}
@@ -1319,7 +1318,7 @@
/*
* Building the zero lsp
*/
- stream_set_putp (lsp->pdu, ISIS_FIXED_HDR_LEN + ISIS_LSP_HDR_LEN);
+ stream_forward_endp (lsp->pdu, ISIS_FIXED_HDR_LEN + ISIS_LSP_HDR_LEN);
/*
* Add the authentication info if its present
*/
@@ -1929,7 +1928,7 @@
}
}
- stream_set_putp (lsp->pdu, ISIS_FIXED_HDR_LEN + ISIS_LSP_HDR_LEN);
+ stream_forward_endp (lsp->pdu, ISIS_FIXED_HDR_LEN + ISIS_LSP_HDR_LEN);
/*
* Add the authentication info if it's present
*/
@@ -1947,7 +1946,7 @@
if (lsp->tlv_data.es_neighs && listcount (lsp->tlv_data.es_neighs) > 0)
tlv_add_is_neighs (lsp->tlv_data.es_neighs, lsp->pdu);
- lsp->lsp_header->pdu_len = htons (stream_get_putp (lsp->pdu));
+ lsp->lsp_header->pdu_len = htons (stream_get_endp (lsp->pdu));
iso_csum_create (STREAM_DATA (lsp->pdu) + 12,
ntohs (lsp->lsp_header->pdu_len) - 12, 12);
@@ -2473,7 +2472,6 @@
}
/* thanks to hannes, another bug bites the dust */
- lsp->pdu->putp = ntohs (lsp->lsp_header->pdu_len);
lsp->pdu->endp = ntohs (lsp->lsp_header->pdu_len);
}
#endif /* TOPOLOGY_GENERATE */