20 Aug 2001 (updated 20 Aug 2001 at 03:58 UTC)
»
I'm glad to see that news coverage is as bad in other countries as it is in ours.
In other news, I started adding all sorts of #define's in
libnet-headers.h so that I could easily have access to all
the packet flags (SYN, RST, PSH, URG, ACK) when calling
libnet_build_tcp() but then I realized that it's just easier
to add the existing constants together. Let me explain for
people like me:
(in libnet-headers.h):
#ifndef TH_FIN
#define TH_FIN 0x01
#endif
#ifndef TH_SYN
#define TH_SYN 0x02
#endif
#ifndef TH_RST
#define TH_RST 0x04
#endif
#ifndef TH_PUSH
#define TH_PUSH 0x08
#endif
#ifndef TH_ACK
#define TH_ACK 0x10
#endif
#ifndef TH_URG
#define TH_URG 0x20
#endif
What was immediately obvious to me is that when you add any
two or three values together, you'll have a new distinct
value. What's funny is that instead of just realizing I
should add them together while calling lib_build_tcp(), I
thought it'd be easier (and more useful to others) if I
added a shitload of new constants. like
TH_SYN_FIN_RST_PUSH_URG, etc.