2810386482
ok sthen@
107 lines
3.1 KiB
Plaintext
107 lines
3.1 KiB
Plaintext
$OpenBSD: patch-ngrep_h,v 1.3 2011/06/18 14:02:38 kili Exp $
|
|
--- ngrep.h.orig Tue Nov 28 14:38:43 2006
|
|
+++ ngrep.h Sat Jun 18 14:55:58 2011
|
|
@@ -7,7 +7,7 @@
|
|
*
|
|
*/
|
|
|
|
-#define VERSION "1.45"
|
|
+#define VERSION "1.46-CVS"
|
|
|
|
/*
|
|
* We cache the standard frame sizes here to save us time and
|
|
@@ -17,12 +17,15 @@
|
|
#define ETHHDR_SIZE 14
|
|
#define TOKENRING_SIZE 22
|
|
#define PPPHDR_SIZE 4
|
|
+#define PPPOEHDR_SIZE 8
|
|
#define SLIPHDR_SIZE 16
|
|
#define RAWHDR_SIZE 0
|
|
#define LOOPHDR_SIZE 4
|
|
#define FDDIHDR_SIZE 21
|
|
#define ISDNHDR_SIZE 16
|
|
#define IEEE80211HDR_SIZE 32
|
|
+#define PFLOGHDR_SIZE 48
|
|
+#define VLANHDR_SIZE 4
|
|
|
|
/*
|
|
* Default patterns for BPF and regular expression filters.
|
|
@@ -34,8 +37,8 @@
|
|
#define BPF_FILTER_IP "(ip)"
|
|
#endif
|
|
|
|
-#define BPF_FILTER_OTHER " and ( %s)"
|
|
-#define BPF_MAIN_FILTER BPF_FILTER_IP BPF_FILTER_OTHER
|
|
+#define BPF_FILTER_OTHER "( %s) and "
|
|
+#define BPF_MAIN_FILTER BPF_FILTER_OTHER BPF_FILTER_IP
|
|
|
|
#define WORD_REGEX "((^%s\\W)|(\\W%s$)|(\\W%s\\W))"
|
|
|
|
@@ -77,25 +80,27 @@ void process(u_char *, struct pcap_pkthdr *, u_char *)
|
|
|
|
void version(void);
|
|
void usage(int8_t);
|
|
+void update_windowsize(int32_t);
|
|
void clean_exit(int32_t);
|
|
|
|
void dump_packet(struct pcap_pkthdr *, u_char *, uint8_t, unsigned char *, uint32_t,
|
|
const char *, const char *, uint16_t, uint16_t, uint8_t,
|
|
uint16_t, uint8_t, uint16_t, uint32_t);
|
|
|
|
-void dump_unwrapped(unsigned char *, uint32_t);
|
|
-void dump_formatted(unsigned char *, uint32_t);
|
|
-void dump_byline (unsigned char *, uint32_t);
|
|
+void dump_unwrapped(unsigned char *, uint32_t, uint16_t, uint16_t);
|
|
+void dump_formatted(unsigned char *, uint32_t, uint16_t, uint16_t);
|
|
+void dump_byline (unsigned char *, uint32_t, uint16_t, uint16_t);
|
|
|
|
void dump_delay_proc_init(struct pcap_pkthdr *);
|
|
void dump_delay_proc (struct pcap_pkthdr *);
|
|
|
|
-int8_t re_match_func (unsigned char *, uint32_t);
|
|
-int8_t bin_match_func (unsigned char *, uint32_t);
|
|
-int8_t blank_match_func(unsigned char *, uint32_t);
|
|
+int8_t re_match_func (unsigned char *, uint32_t, uint16_t *, uint16_t *);
|
|
+int8_t bin_match_func (unsigned char *, uint32_t, uint16_t *, uint16_t *);
|
|
+int8_t blank_match_func(unsigned char *, uint32_t, uint16_t *, uint16_t *);
|
|
|
|
void print_time_absolute(struct pcap_pkthdr *);
|
|
void print_time_diff (struct pcap_pkthdr *);
|
|
+void print_time_offset (struct pcap_pkthdr *);
|
|
|
|
char *get_filter_from_string(char *);
|
|
char *get_filter_from_argv (char **);
|
|
@@ -103,7 +108,6 @@ char *get_filter_from_argv (char **);
|
|
uint8_t strishex(char *);
|
|
|
|
#if !defined(_WIN32)
|
|
-void update_windowsize(int32_t);
|
|
void drop_privs(void);
|
|
#endif
|
|
|
|
@@ -111,6 +115,7 @@ void drop_privs(void);
|
|
int8_t win32_initwinsock(void);
|
|
void win32_listdevices(void);
|
|
char *win32_usedevice(const char *);
|
|
+char *win32_choosedevice(void);
|
|
#endif
|
|
|
|
|
|
@@ -120,4 +125,16 @@ struct NGREP_rtaphdr_t {
|
|
uint16_t it_len;
|
|
uint32_t it_present;
|
|
};
|
|
+
|
|
+
|
|
+/*
|
|
+ * ANSI color/hilite stuff.
|
|
+ */
|
|
+
|
|
+const char ANSI_red[] = "\33[01;31m";
|
|
+const char ANSI_bold[] = "\33[01m";
|
|
+
|
|
+const char *ANSI_hilite = ANSI_red;
|
|
+const char ANSI_off[] = "\33[00m";
|
|
+
|
|
|