+/*
+ * In case the data in a buffer needs to be processed by being decrypted,
+ * decompressed, etc. before it's dissected, we can't process it in place,
+ * we have to allocate a new buffer for the processed data.
+ *
+ * We keep a stack of those buffers; when we allocate a new buffer, we
+ * push the current one onto a stack, and when we're done with the new
+ * buffer, we free the current buffer and pop the previous one off the
+ * stack.
+ *
+ * A buffer has a beginnning and end pointer, and a link to the previous
+ * buffer on the stack.
+ *
+ * In other cases, we temporarily adjust the snapshot end to reflect a
+ * packet-length field in the packet data and, when finished dissecting
+ * that part of the packet, restore the old snapshot end. We keep that
+ * on the stack with null buffer pointer, meaning there's nothing to
+ * free.
+ */
+struct netdissect_saved_packet_info {
+ u_char *ndspi_buffer; /* pointer to allocated buffer data */
+ const u_char *ndspi_packetp; /* saved beginning of data */
+ const u_char *ndspi_snapend; /* saved end of data */
+ struct netdissect_saved_packet_info *ndspi_prev; /* previous buffer on the stack */
+};
+