Lines Matching +full:- +full:- +full:fail +full:- +full:at +full:- +full:end
2 * Copyright (c) 1988-1997
5 * Copyright (c) 1998-2012 Michael Richardson <mcr@tcpdump.org>
29 #include "netdissect-stdinc.h"
43 * This should be called at the beginning of the program; it does
63 return (-1); in nd_init()
69 * XXX - should we just fail if this fails? Some of the in nd_init()
70 * libsmi calls may fail. in nd_init()
77 * "unused argument" warnings at compile time. in nd_init()
128 return (-1); in nd_load_smi_module()
135 return (-1); in nd_load_smi_module()
158 return (0); /* fail */ in nd_push_buffer()
159 ndspi->ndspi_buffer = new_buffer; in nd_push_buffer()
160 ndspi->ndspi_packetp = ndo->ndo_packetp; in nd_push_buffer()
161 ndspi->ndspi_snapend = ndo->ndo_snapend; in nd_push_buffer()
162 ndspi->ndspi_prev = ndo->ndo_packet_info_stack; in nd_push_buffer()
164 ndo->ndo_packetp = new_packetp; in nd_push_buffer()
165 ndo->ndo_snapend = new_packetp + newlen; in nd_push_buffer()
166 ndo->ndo_packet_info_stack = ndspi; in nd_push_buffer()
179 * the packet, calculate a new snapshot end that's at the lower
180 * of the current snapshot end and that point in the packet;
182 * set the snapshot end to that new value.
192 return (0); /* fail */ in nd_push_snaplen()
193 ndspi->ndspi_buffer = NULL; /* no new buffer */ in nd_push_snaplen()
194 ndspi->ndspi_packetp = ndo->ndo_packetp; in nd_push_snaplen()
195 ndspi->ndspi_snapend = ndo->ndo_snapend; in nd_push_snaplen()
196 ndspi->ndspi_prev = ndo->ndo_packet_info_stack; in nd_push_snaplen()
201 ndo->ndo_packet_info_stack = ndspi; in nd_push_snaplen()
206 * We're restricted to packets with at most UINT_MAX bytes; in nd_push_snaplen()
210 * should at most be equal to snapend, and must *never* in nd_push_snaplen()
213 snaplen_remaining = (u_int)(ndo->ndo_snapend - bp); in nd_push_snaplen()
222 ndo->ndo_snapend = bp + newlen; in nd_push_snaplen()
232 * the packet, calculate a new snapshot end that's at the lower
233 * of the previous snapshot end - or, if there is no previous
234 * snapshot end, the current snapshot end - and that point in the
237 * set the snapshot end to that new value.
239 * This is to change the current snapshot end. This may increase the
240 * snapshot end, as it may be used, for example, for a Jumbo Payload
251 ndspi = ndo->ndo_packet_info_stack; in nd_change_snaplen()
252 if (ndspi->ndspi_prev != NULL) in nd_change_snaplen()
253 previous_snapend = ndspi->ndspi_prev->ndspi_snapend; in nd_change_snaplen()
255 previous_snapend = ndo->ndo_snapend; in nd_change_snaplen()
259 * snapend - or, if there is no previous snapend, after in nd_change_snaplen()
262 * We're restricted to packets with at most UINT_MAX bytes; in nd_change_snaplen()
266 * should at most be equal to snapend, and must *never* in nd_change_snaplen()
269 snaplen_remaining = (u_int)(previous_snapend - bp); in nd_change_snaplen()
278 ndo->ndo_snapend = bp + newlen; in nd_change_snaplen()
287 ndspi = ndo->ndo_packet_info_stack; in nd_pop_packet_info()
288 ndo->ndo_packetp = ndspi->ndspi_packetp; in nd_pop_packet_info()
289 ndo->ndo_snapend = ndspi->ndspi_snapend; in nd_pop_packet_info()
290 ndo->ndo_packet_info_stack = ndspi->ndspi_prev; in nd_pop_packet_info()
292 free(ndspi->ndspi_buffer); in nd_pop_packet_info()
299 while (ndo->ndo_packet_info_stack != NULL) in nd_pop_all_packet_info()