#include "util.h"
#undef sun
-#define IGNORE(x) do if (x); while (0)
/*----- Data structures ---------------------------------------------------*/
extern "C" {
#endif
+/*----- Macros ------------------------------------------------------------*/
+
+/* --- @IGNORE@ --- *
+ *
+ * Arguments: @expr@ = an expression whose value is to be ignored
+ *
+ * Use: Ignores the value of an expression, even if compilers want
+ * us not to.
+ */
+
+#define IGNORE(expr) do { if (expr) ; } while (0)
+
/*----- Functions provided ------------------------------------------------*/
/* --- @u_quotify@ --- *
#include <mLib/sel.h>
#include <mLib/selpk.h>
+#include "util.h"
+
/*----- Data structures ---------------------------------------------------*/
typedef struct pk {
{
pkstream *p = vp;
size_t pksz;
- int hunoz;
if (!sz) {
doclose(p);
}
pksz = LOAD16(b);
if (pksz + 2 == sz) {
- hunoz = write(fd_udp, b + 2, pksz);
+ IGNORE(write(fd_udp, b + 2, pksz));
selpk_want(&p->p, 2);
} else {
selpk_want(&p->p, pksz + 2);
#include <catacomb/rand.h>
#include <catacomb/rc4.h>
+#include "util.h"
+
/*----- Data structures ---------------------------------------------------*/
typedef struct peer {
static void dosend(filter *f, const octet *buf, size_t sz)
{
- int hunoz;
-
printf("send to `%s'\n", f->p_to->name);
- hunoz = write(f->p_to->sf.fd, buf, sz);
+ IGNORE(write(f->p_to->sf.fd, buf, sz));
}
static void addsend(filter *f, unsigned ac, char **av)
static void t_inject(tunnel *t, buf *b)
{
- int hunoz;
-
IF_TRACING(T_TUNNEL, {
trace(T_TUNNEL, "tun-bsd: inject decrypted packet");
trace_block(T_PACKET, "tun-bsd: packet contents", BBASE(b), BLEN(b));
})
- hunoz = write(t->f.fd, BBASE(b), BLEN(b));
+ IGNORE(write(t->f.fd, BBASE(b), BLEN(b)));
}
/* --- @t_destroy@ --- *
static void t_inject(tunnel *t, buf *b)
{
- int hunoz;
-
IF_TRACING(T_TUNNEL, {
trace(T_TUNNEL, "tun-linux: inject decrypted packet");
trace_block(T_PACKET, "tunnel: packet contents", BBASE(b), BLEN(b));
})
- hunoz = write(t->f.fd, BBASE(b), BLEN(b));
+ IGNORE(write(t->f.fd, BBASE(b), BLEN(b)));
}
/* --- @t_destroy@ --- *
static void t_inject(tunnel *t, buf *b)
{
- int hunoz;
-
IF_TRACING(T_TUNNEL, {
trace(T_TUNNEL, "tun-unet: inject decrypted packet");
trace_block(T_PACKET, "tun-unet: packet contents", BBASE(b), BLEN(b));
})
- hunoz = write(t->f.fd, BBASE(b), BLEN(b));
+ IGNORE(write(t->f.fd, BBASE(b), BLEN(b)));
}
/* --- @t_destroy@ --- *