pcap_t *pcap_open_offline_common(char *ebuf, size_t size);
void sf_cleanup(pcap_t *p);
+/*
+ * Internal interfaces for both "pcap_create()" and routines that
+ * open savefiles.
+ *
+ * "pcap_oneshot()" is the standard one-shot callback for "pcap_next()"
+ * and "pcap_next_ex()".
+ */
+void pcap_oneshot(u_char *, const struct pcap_pkthdr *, const u_char *);
+
#ifdef WIN32
char *pcap_win32strerror(void);
#endif
* packet data cannot be guaranteed to be available after the callback
* returns, so that a copy must be made.
*/
-static void
+void
pcap_oneshot(u_char *user, const struct pcap_pkthdr *h, const u_char *pkt)
{
struct oneshot_userdata *sp = (struct oneshot_userdata *)user;
p->cleanup_op = pcap_cleanup_live_common;
/*
- * In most cases, the standard one-short callback can
+ * In most cases, the standard one-shot callback can
* be used for pcap_next()/pcap_next_ex().
*/
p->oneshot_callback = pcap_oneshot;
p->setmode_op = sf_setmode;
p->setmintocopy_op = sf_setmintocopy;
#endif
+
+ /*
+ * For offline captures, the standard one-shot callback can
+ * be used for pcap_next()/pcap_next_ex().
+ */
+ p->oneshot_callback = pcap_oneshot;
+
p->activated = 1;
return (p);