*
* Hack to set minimum snaplen to tcpdump's default:
*/
- snaplen = max(snaplen, 96);
+ snaplen = MAX(snaplen, 96);
#endif
if (opt_want_snaplen > -1)
snaplen = opt_want_snaplen;
#else
/* We have a BSD-like BPF, we can select() on it. */
FD_SET(pcap_fd, read_set);
- *max_fd = max(*max_fd, pcap_fd);
+ *max_fd = MAX(*max_fd, pcap_fd);
#endif
}
#define restrict __restrict
#endif
-#ifndef max
-# define max(a,b) ((a) > (b) ? (a) : (b))
+#ifndef MAX
+# define MAX(a,b) ((a) > (b) ? (a) : (b))
#endif
-#ifndef min
-# define min(a,b) ((a) < (b) ? (a) : (b))
+#ifndef MIN
+# define MIN(a,b) ((a) < (b) ? (a) : (b))
#endif
/* vim:set ts=3 sw=3 tw=78 expandtab: */
int
getsnaplen(const struct linkhdr *lh)
{
- return (int)(lh->hdrlen + IPV6_HDR_LEN + max(TCP_HDR_LEN, UDP_HDR_LEN));
+ return (int)(lh->hdrlen + IPV6_HDR_LEN + MAX(TCP_HDR_LEN, UDP_HDR_LEN));
}
/* Decoding functions. */
start = 0;
end = ht->count;
} else
- end = min(ht->count, (uint32_t)start+MAX_ENTRIES);
+ end = MIN(ht->count, (uint32_t)start+MAX_ENTRIES);
str_appendf(buf, "(%u-%u of %u)<br>\n", start+1, end, ht->count);
qsort_buckets(table, ht->count, start, end, sort);
}
pn = a + n;
- r = min(pa - a, pb - pa);
+ r = MIN(pa - a, pb - pa);
vecswap(a, pb - r, r);
- r = min(pd - pc, pn - pd - 1);
+ r = MIN(pd - pc, pn - pd - 1);
vecswap(pb, pn - r, r);
if (((r = pb - pa) > 1) && ((unsigned)r >= left))
qsort_buckets(a, r, left, right, dir);
static int *insocks = NULL;
static unsigned int insock_num = 0;
-#ifndef min
-#define min(a,b) (((a) < (b)) ? (a) : (b))
-#endif
-
struct connection {
LIST_ENTRY(connection) entries;
unsigned int i;
#define MAX_FD_SET(sock, fdset) do { \
- FD_SET(sock, fdset); *max_fd = max(*max_fd, sock); } while(0)
+ FD_SET(sock, fdset); *max_fd = MAX(*max_fd, sock); } while(0)
for (i=0; i<insock_num; i++)
MAX_FD_SET(insocks[i], recv_set);
/* Connections that need a timeout. */
if (conn->state != DONE)
- minidle = min(minidle, (idletime - idlefor));
+ minidle = MIN(minidle, (idletime - idlefor));
switch (conn->state)
{