f8b4f8b14a
update; noticed by naddy@
104 lines
2.6 KiB
Plaintext
104 lines
2.6 KiB
Plaintext
$OpenBSD: patch-tcpip_h,v 1.1 2003/04/22 12:08:05 avsm Exp $
|
|
--- tcpip.h.orig Tue Sep 22 21:35:43 1998
|
|
+++ tcpip.h Mon Apr 14 23:50:21 2003
|
|
@@ -4,12 +4,12 @@ typedef struct
|
|
{
|
|
unsigned char vh;
|
|
unsigned char stype;
|
|
- unsigned short length;
|
|
- unsigned short ident;
|
|
- unsigned short frag;
|
|
+ u_int16_t length;
|
|
+ u_int16_t ident;
|
|
+ u_int16_t frag;
|
|
unsigned char ttl;
|
|
unsigned char protocol;
|
|
- unsigned short cksum;
|
|
+ u_int16_t cksum;
|
|
struct in_addr sip;
|
|
struct in_addr dip;
|
|
}
|
|
@@ -17,15 +17,15 @@ iprec;
|
|
|
|
typedef struct
|
|
{
|
|
- unsigned short sport;
|
|
- unsigned short dport;
|
|
- unsigned long seqnum;
|
|
- unsigned long acknum;
|
|
+ u_int16_t sport;
|
|
+ u_int16_t dport;
|
|
+ u_int32_t seqnum;
|
|
+ u_int32_t acknum;
|
|
unsigned char txoff;
|
|
unsigned char flags;
|
|
- unsigned short window;
|
|
- unsigned short cksum;
|
|
- unsigned short urgentptr;
|
|
+ u_int16_t window;
|
|
+ u_int16_t cksum;
|
|
+ u_int16_t urgentptr;
|
|
}
|
|
tcprec;
|
|
|
|
@@ -35,7 +35,7 @@ typedef struct
|
|
struct in_addr dip;
|
|
unsigned char zero;
|
|
unsigned char proto;
|
|
- unsigned short tcplen;
|
|
+ u_int16_t tcplen;
|
|
}
|
|
tcpsrec;
|
|
|
|
@@ -43,12 +43,12 @@ typedef struct
|
|
{
|
|
unsigned char type;
|
|
unsigned char code;
|
|
- unsigned short cksum;
|
|
- unsigned long zero;
|
|
+ u_int16_t cksum;
|
|
+ u_int32_t zero;
|
|
iprec ip;
|
|
- unsigned short sport;
|
|
- unsigned short dport;
|
|
- unsigned long seq;
|
|
+ u_int16_t sport;
|
|
+ u_int16_t dport;
|
|
+ u_int32_t seq;
|
|
}
|
|
icmprec;
|
|
|
|
@@ -67,23 +67,23 @@ typedef struct
|
|
{
|
|
struct sockaddr_in from;
|
|
struct sockaddr_in dest;
|
|
- unsigned short sport;
|
|
- unsigned short dport;
|
|
- unsigned long seq;
|
|
- unsigned long ack;
|
|
+ u_int16_t sport;
|
|
+ u_int16_t dport;
|
|
+ u_int32_t seq;
|
|
+ u_int32_t ack;
|
|
}
|
|
spoofrec;
|
|
|
|
/* -------------- Prototiping --------------- */
|
|
void init_tcpip(void);
|
|
int init_pcap(char*);
|
|
-unsigned short in_cksum (unsigned short *, int);
|
|
+u_int16_t in_cksum (u_int16_t *, int);
|
|
void sendip (spoofrec *, char *, short, short *, short *, short);
|
|
-unsigned short tcpcksum (spoofrec *, char *, short);
|
|
+u_int16_t tcpcksum (spoofrec *, char *, short);
|
|
short resolve_host (char *, struct sockaddr_in *);
|
|
short gettcp (spoofrec *, tcprec *);
|
|
-void sendtcp (spoofrec *, unsigned short, short);
|
|
-void sendicmp (spoofrec *, struct sockaddr_in *, unsigned short);
|
|
-struct in_addr getlocalip (unsigned long dest);
|
|
+void sendtcp (spoofrec *, u_int16_t, short);
|
|
+void sendicmp (spoofrec *, struct sockaddr_in *, u_int16_t);
|
|
+struct in_addr getlocalip (u_int32_t dest);
|
|
char *tcpip_id(void);
|
|
|