oskittcp can now be built with vs6

svn path=/trunk/; revision=10990
This commit is contained in:
Royce Mitchell III 2004-09-23 03:02:29 +00:00
parent 696d3bd2b6
commit 438e4eae22
42 changed files with 759 additions and 78 deletions

View file

@ -0,0 +1,9 @@
*.d
*.exe
*.map
*.ncb
*.opt
*.plg
*.sym
Debug
Release

View file

@ -1,15 +1,22 @@
#ifdef _MSC_VER
#pragma warning ( disable : 4786 )
#endif//_MSC_VER
#include <list>
#include <string>
#include <sstream>
#include <malloc.h>
extern "C" {
typedef unsigned short u_short;
#include <stdio.h>
#include <oskittcp.h>
#include <windows.h>
#ifndef _MSC_VER
#include <winsock2.h>
#endif//_MSC_VER
};
char hwaddr[6] = { 0x08, 0x00, 0x20, 0x0b, 0xb7, 0xbb };
unsigned char hwaddr[6] = { 0x08, 0x00, 0x20, 0x0b, 0xb7, 0xbb };
#undef malloc
#undef free
@ -25,12 +32,20 @@ typedef struct _CONNECTION_ENDPOINT {
OSK_UINT State;
} CONNECTION_ENDPOINT, *PCONNECTION_ENDPOINT;
extern "C" int is_stack_ptr ( const void* p )
{
MEMORY_BASIC_INFORMATION mbi1, mbi2;
VirtualQuery ( p, &mbi1, sizeof(mbi1) );
VirtualQuery ( _alloca(1), &mbi2, sizeof(mbi2) );
return mbi1.AllocationBase == mbi2.AllocationBase;
}
int TCPSocketState(void *ClientData,
void *WhichSocket,
void *WhichConnection,
OSK_UINT NewState ) {
PCONNECTION_ENDPOINT Connection = (PCONNECTION_ENDPOINT)WhichConnection;
PLIST_ENTRY Entry;
//PLIST_ENTRY Entry;
TI_DbgPrint(MID_TRACE,("Called: NewState %x\n", NewState));
@ -218,7 +233,7 @@ int main( int argc, char **argv ) {
if( datagram[0] == 'C' && datagram[1] == 'M' &&
datagram[2] == 'D' && datagram[3] == ' ' ) {
int theport, bytes, recvret, off, bytin;
int theport, bytes, /*recvret,*/ off, bytin;
struct sockaddr_in nam;
std::string faddr, word;
std::istringstream

View file

@ -0,0 +1,434 @@
# Microsoft Developer Studio Project File - Name="tcptest" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=tcptest - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "tcptest.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "tcptest.mak" CFG="tcptest - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "tcptest - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "tcptest - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "tcptest - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "tcptest - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../drivers/lib/oskittcp/include" /I "vc6" /I "../../../drivers\lib\oskittcp\include\freebsd\src\sys" /I "../../../drivers\lib\oskittcp\include\freebsd\dev\include" /I "../../../drivers\lib\oskittcp\include\freebsd\net\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "KERNEL" /D __REACTOS__=1 /D "FREEZAP" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "tcptest - Win32 Release"
# Name "tcptest - Win32 Debug"
# Begin Group "tcptest"
# PROP Default_Filter ""
# Begin Source File
SOURCE=.\tcptest.cpp
!IF "$(CFG)" == "tcptest - Win32 Release"
!ELSEIF "$(CFG)" == "tcptest - Win32 Debug"
# SUBTRACT CPP /D "KERNEL"
!ENDIF
# End Source File
# End Group
# Begin Group "oskittcp"
# PROP Default_Filter ""
# Begin Group "src"
# PROP Default_Filter ""
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\oskittcp\defaults.c
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\oskittcp\in.c
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\oskittcp\in_cksum.c
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\oskittcp\in_pcb.c
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\oskittcp\in_proto.c
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\oskittcp\in_rmx.c
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\oskittcp\inet_ntoa.c
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\oskittcp\interface.c
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\oskittcp\ip_input.c
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\oskittcp\ip_output.c
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\oskittcp\kern_clock.c
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\oskittcp\kern_subr.c
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\oskittcp\param.c
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\oskittcp\radix.c
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\oskittcp\random.c
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\oskittcp\raw_cb.c
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\oskittcp\raw_ip.c
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\oskittcp\raw_usrreq.c
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\oskittcp\route.c
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\oskittcp\rtsock.c
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\oskittcp\scanc.c
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\oskittcp\sleep.c
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\oskittcp\tcp_debug.c
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\oskittcp\tcp_input.c
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\oskittcp\tcp_output.c
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\oskittcp\tcp_subr.c
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\oskittcp\tcp_timer.c
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\oskittcp\tcp_usrreq.c
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\oskittcp\uipc_domain.c
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\oskittcp\uipc_mbuf.c
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\oskittcp\uipc_socket.c
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\oskittcp\uipc_socket2.c
# End Source File
# End Group
# Begin Group "include"
# PROP Default_Filter ""
# Begin Group "freebsd"
# PROP Default_Filter ""
# Begin Group "src No. 1"
# PROP Default_Filter ""
# Begin Group "sys"
# PROP Default_Filter ""
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\include\freebsd\src\sys\sys\buf.h
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\include\freebsd\src\sys\sys\callout.h
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\include\freebsd\src\sys\sys\cdefs.h
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\include\freebsd\src\sys\sys\domain.h
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\include\freebsd\src\sys\sys\errno.h
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\include\freebsd\src\sys\sys\fcntl.h
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\include\freebsd\src\sys\sys\file.h
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\include\freebsd\src\sys\sys\filedesc.h
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\include\freebsd\src\sys\sys\filio.h
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\include\freebsd\src\sys\sys\ioccom.h
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\include\freebsd\src\sys\sys\ioctl.h
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\include\freebsd\src\sys\sys\kernel.h
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\include\freebsd\src\sys\sys\libkern.h
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\include\freebsd\src\sys\sys\malloc.h
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\include\freebsd\src\sys\sys\mbuf.h
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\include\freebsd\src\sys\sys\param.h
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\include\freebsd\src\sys\sys\proc.h
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\include\freebsd\src\sys\sys\protosw.h
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\include\freebsd\src\sys\sys\queue.h
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\include\freebsd\src\sys\sys\resource.h
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\include\freebsd\src\sys\sys\resourcevar.h
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\include\freebsd\src\sys\sys\rtprio.h
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\include\freebsd\src\sys\sys\select.h
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\include\freebsd\src\sys\sys\signal.h
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\include\freebsd\src\sys\sys\signalvar.h
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\include\freebsd\src\sys\sys\socket.h
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\include\freebsd\src\sys\sys\socketvar.h
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\include\freebsd\src\sys\sys\sockio.h
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\include\freebsd\src\sys\sys\stat.h
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\include\freebsd\src\sys\sys\sysctl.h
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\include\freebsd\src\sys\sys\syslimits.h
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\include\freebsd\src\sys\sys\syslog.h
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\include\freebsd\src\sys\sys\systm.h
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\include\freebsd\src\sys\sys\time.h
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\include\freebsd\src\sys\sys\ttycom.h
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\include\freebsd\src\sys\sys\types.h
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\include\freebsd\src\sys\sys\ucred.h
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\include\freebsd\src\sys\sys\uio.h
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\include\freebsd\src\sys\sys\unistd.h
# End Source File
# End Group
# End Group
# End Group
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\include\memtrack.h
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\include\oskitdebug.h
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\include\oskiterrno.h
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\include\oskitfreebsd.h
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\include\oskittcp.h
# End Source File
# Begin Source File
SOURCE=..\..\..\drivers\lib\oskittcp\include\oskittypes.h
# End Source File
# End Group
# End Group
# End Target
# End Project

View file

@ -0,0 +1,29 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "tcptest"=.\tcptest.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

View file

@ -41,13 +41,17 @@
#include <sys/cdefs.h>
__BEGIN_DECLS
#ifndef _WINSOCKAPI_
unsigned long inet_addr __P((const char *));
#endif//_WINSOCKAPI_
int inet_aton __P((const char *, struct in_addr *));
unsigned long inet_lnaof __P((struct in_addr));
struct in_addr inet_makeaddr __P((u_long , u_long));
unsigned long inet_netof __P((struct in_addr));
unsigned long inet_network __P((const char *));
#ifndef _WINSOCKAPI_
char *inet_ntoa __P((struct in_addr));
#endif//_WINSOCKAPI_
__END_DECLS
#endif /* !_INET_H_ */

View file

@ -303,6 +303,31 @@ write_eflags(u_long ef)
__asm __volatile("pushl %0; popfl" : : "r" (ef));
}
#else /* !__GNUC__ */
int bdb __P((void));
void disable_intr __P((void));
void enable_intr __P((void));
u_char inb __P((u_int port));
u_long inl __P((u_int port));
void insb __P((u_int port, void *addr, size_t cnt));
void insl __P((u_int port, void *addr, size_t cnt));
void insw __P((u_int port, void *addr, size_t cnt));
u_short inw __P((u_int port));
u_int loadandclear __P((u_int *addr));
void outb __P((u_int port, u_char data));
void outl __P((u_int port, u_long data));
void outsb __P((u_int port, void *addr, size_t cnt));
void outsl __P((u_int port, void *addr, size_t cnt));
void outsw __P((u_int port, void *addr, size_t cnt));
void outw __P((u_int port, u_short data));
void pmap_update __P((void));
u_long read_eflags __P((void));
u_long rcr2 __P((void));
void write_eflags __P((u_long ef));
#endif /* __GNUC__ */
/*
* XXX queue stuff belongs elsewhere.
*/
@ -333,34 +358,6 @@ remque(void *a)
element->qh_rlink = 0;
}
#else /* !__GNUC__ */
int bdb __P((void));
void disable_intr __P((void));
void enable_intr __P((void));
u_char inb __P((u_int port));
u_long inl __P((u_int port));
void insb __P((u_int port, void *addr, size_t cnt));
void insl __P((u_int port, void *addr, size_t cnt));
void insw __P((u_int port, void *addr, size_t cnt));
u_short inw __P((u_int port));
u_int loadandclear __P((u_int *addr));
void outb __P((u_int port, u_char data));
void outl __P((u_int port, u_long data));
void outsb __P((u_int port, void *addr, size_t cnt));
void outsl __P((u_int port, void *addr, size_t cnt));
void outsw __P((u_int port, void *addr, size_t cnt));
void outw __P((u_int port, u_short data));
void pmap_update __P((void));
u_long read_eflags __P((void));
u_long rcr2 __P((void));
void write_eflags __P((u_long ef));
void insque __P((void *a, void *b));
void remque __P((void *a));
#endif /* __GNUC__ */
/*
* XXX the following declarations document garbage in support.s.
* gcc hasn't needed _divsi* for years.

View file

@ -56,6 +56,27 @@
#include <sys/cdefs.h>
#endif
#ifdef _MSC_VER
static inline unsigned long __byte_swap_long ( unsigned long i )
{
char dst[4];
char* src = (char*)&i;
dst[0] = src[3];
dst[1] = src[2];
dst[2] = src[1];
dst[3] = src[0];
return *(unsigned long*)&dst[0];
}
static inline unsigned short __byte_swap_word ( unsigned short i )
{
char dst[2];
char* src = (char*)&i;
dst[0] = src[1];
dst[1] = src[0];
return *(unsigned short*)&dst[0];
}
#else/*_MSC_VER*/
#define __word_swap_long(x) \
({ register u_long __X = (x); \
__asm ("rorl $16, %1" \
@ -89,6 +110,7 @@ __extension__ ({ register u_short __X = (x); \
: "0" (__X)); \
__X; })
#endif /* __GNUC__ >= 2 */
#endif /* _MSC_VER */
/*
* Macros for network/external number representation conversion.

View file

@ -54,7 +54,9 @@
#define SCHAR_MAX 127 /* min value for a signed char */
#define SCHAR_MIN (-128) /* max value for a signed char */
#ifndef _MSC_VER
#define UCHAR_MAX 255 /* max value for an unsigned char */
#endif//_MSC_VER
#ifndef __REACTOS__
#define CHAR_MAX 127 /* max value for a char */
#define CHAR_MIN (-128) /* min value for a char */

View file

@ -172,7 +172,15 @@ extern unsigned tty_imask; /* group of interrupts masked with spltty() */
#define schedsofttty() (*(unsigned *)&idelayed |= SWI_TTY_PENDING)
#ifdef __GNUC__
#ifdef _MSC_VER
static int splhigh() { return 0; }
static int splimp() { return 0; }
static int splnet() { return 0; }
static int splx() { return 0; }
static int splclock() { return 0; }
#elif defined(__GNUC__)
void splz __P((void));

View file

@ -36,6 +36,10 @@
#ifndef _STDARG_H_
#define _STDARG_H_
#ifdef _MSC_VER
#include <stdarg.h>
#else
typedef char *va_list;
#ifdef __GNUC__
@ -60,4 +64,6 @@ typedef char *va_list;
#define va_end(ap)
#endif
#endif /* !_STDARG_H_ */

View file

@ -59,7 +59,12 @@ typedef short int16_t;
typedef unsigned short u_int16_t;
typedef int int32_t;
typedef unsigned int u_int32_t;
#ifdef _MSC_VER
typedef __int64 int64_t;
typedef unsigned __int64 u_int64_t;
#else
typedef long long int64_t;
typedef unsigned long long u_int64_t;
#endif
#endif /* _MACHTYPES_H_ */

View file

@ -88,16 +88,6 @@ struct ether_header;
* (Would like to call this struct ``if'', but C isn't PL/1.)
*/
struct ifnet {
char *if_name; /* name, e.g. ``en'' or ``lo'' */
struct ifnet *if_next; /* all struct ifnets are chained */
struct ifaddr *if_addrlist; /* linked list of addresses per if */
int if_pcount; /* number of promiscuous listeners */
caddr_t if_bpf; /* packet filter structure */
u_short if_index; /* numeric abbreviation for this if */
short if_unit; /* sub-unit for lower level driver */
short if_timer; /* time 'til if_watchdog called */
short if_flags; /* up/down, broadcast, etc. */
struct if_data {
/* generic interface information */
u_char ifi_type; /* ethernet, tokenring, etc */
@ -120,7 +110,20 @@ struct ifnet {
u_long ifi_iqdrops; /* dropped on input, this interface */
u_long ifi_noproto; /* destined for unsupported protocol */
struct timeval ifi_lastchange;/* time of last administrative change */
} if_data;
};
struct ifnet {
char *if_name; /* name, e.g. ``en'' or ``lo'' */
struct ifnet *if_next; /* all struct ifnets are chained */
struct ifaddr *if_addrlist; /* linked list of addresses per if */
int if_pcount; /* number of promiscuous listeners */
caddr_t if_bpf; /* packet filter structure */
u_short if_index; /* numeric abbreviation for this if */
short if_unit; /* sub-unit for lower level driver */
short if_timer; /* time 'til if_watchdog called */
short if_flags; /* up/down, broadcast, etc. */
struct if_data if_data;
/* procedure handles */
void (*if_init) /* init routine */
__P((int));

View file

@ -76,9 +76,11 @@
/*
* Internet address (a structure for historical reasons)
*/
#ifndef _WINSOCKAPI_
struct in_addr {
u_long s_addr;
};
#endif//_WINSOCKAPI_
/*
* Definitions of bits in internet address integers.
@ -126,6 +128,9 @@ struct in_addr {
/*
* Socket address, internet style.
*/
#ifdef _WINSOCKAPI_
#define sockaddr_in bsd_sockaddr_in
#endif
struct sockaddr_in {
u_char sin_len;
u_char sin_family;
@ -255,7 +260,9 @@ int in_cksum __P((struct mbuf *, int));
int in_localaddr __P((struct in_addr));
u_long in_netof __P((struct in_addr));
void in_socktrim __P((struct sockaddr_in *));
#ifndef _WINSOCKAPI_
char *inet_ntoa __P((struct in_addr)); /* in libkern */
#endif//_WINSOCKAPI_
#endif
#endif

View file

@ -113,7 +113,9 @@ struct tcphdr {
/*
* User-settable options (used with setsockopt).
*/
#ifndef _WINSOCKAPI_
#define TCP_NODELAY 0x01 /* don't delay send to coalesce packets */
#endif/*_WINSOCKAPI_*/
#define TCP_MAXSEG 0x02 /* set maximum segment size */
#define TCP_NOPUSH 0x04 /* don't push last block of write */
#define TCP_NOOPT 0x08 /* don't use TCP options */

View file

@ -98,6 +98,10 @@
#endif /* !NO_ANSI_KEYWORDS */
#endif /* !(__STDC__ || __cplusplus) */
#ifdef _MSC_VER
# undef __CONCAT
# define __CONCAT(x,y) x ## y
#endif/*_MSC_VER*/
/*
* GCC1 and some versions of GCC2 declare dead (non-returning) and
* pure (no side effects) functions using "volatile" and "const";

View file

@ -55,8 +55,10 @@ extern int errno; /* global error number */
#define ENOEXEC 8 /* Exec format error */
#define EBADF 9 /* Bad file descriptor */
#define ECHILD 10 /* No child processes */
#ifndef EDEADLK
#define EDEADLK 11 /* Resource deadlock avoided */
/* 11 was EAGAIN */
#endif//EDEADLK
#define ENOMEM 12 /* Cannot allocate memory */
#define EACCES 13 /* Permission denied */
#define EFAULT 14 /* Bad address */
@ -88,7 +90,9 @@ extern int errno; /* global error number */
#define ERANGE 34 /* Result too large */
/* non-blocking and interrupt i/o */
#ifndef EAGAIN
#define EAGAIN 35 /* Resource temporarily unavailable */
#endif//EAGAIN
#ifndef _POSIX_SOURCE
#define EWOULDBLOCK EAGAIN /* Operation would block */
#define EINPROGRESS 36 /* Operation now in progress */
@ -124,14 +128,18 @@ extern int errno; /* global error number */
#define ELOOP 62 /* Too many levels of symbolic links */
#endif /* _POSIX_SOURCE */
#ifndef ENAMETOOLONG
#define ENAMETOOLONG 63 /* File name too long */
#endif//ENAMETOOLONG
/* should be rearranged */
#ifndef _POSIX_SOURCE
#define EHOSTDOWN 64 /* Host is down */
#define EHOSTUNREACH 65 /* No route to host */
#endif /* _POSIX_SOURCE */
#ifndef ENOTEMPTY
#define ENOTEMPTY 66 /* Directory not empty */
#endif//ENOTEMPTY
/* quotas & mush */
#ifndef _POSIX_SOURCE
@ -149,8 +157,12 @@ extern int errno; /* global error number */
#define EPROCUNAVAIL 76 /* Bad procedure for program */
#endif /* _POSIX_SOURCE */
#ifndef ENOLCK
#define ENOLCK 77 /* No locks available */
#endif//ENOLCK
#ifndef ENOSYS
#define ENOSYS 78 /* Function not implemented */
#endif//ENOSYS
#ifndef _POSIX_SOURCE
#define EFTYPE 79 /* Inappropriate file type or format */

View file

@ -56,7 +56,11 @@ extern char kernelname[MAXPATHLEN];
extern volatile struct timeval mono_time;
extern struct timeval boottime;
extern struct timeval runtime;
#ifdef _MSC_VER /* TODO FIXME - need a library-specific macro for this one */
extern volatile struct timeval kern_time;
#else/*_MSC_VER*/
extern volatile struct timeval time;
#endif/*_MSC_VER*/
extern struct timezone tz; /* XXX */
extern int tick; /* usec per tick (1000000 / hz) */
@ -76,8 +80,12 @@ extern long timedelta;
* ld/ld.h. Since their calculation requires arithmetic, we
* can't name them symbolically (e.g., 23 is N_SETT | N_EXT).
*/
#ifdef _MSC_VER
#define MAKE_SET(set, sym, type)
#else
#define MAKE_SET(set, sym, type) \
asm(".stabs \"_" #set "\", " #type ", 0, 0, _" #sym)
#endif
#define TEXT_SET(set, sym) MAKE_SET(set, sym, 23)
#define DATA_SET(set, sym) MAKE_SET(set, sym, 25)
#define BSS_SET(set, sym) MAKE_SET(set, sym, 27)

View file

@ -39,6 +39,12 @@ static __inline int imax(int a, int b) { return (a > b ? a : b); }
static __inline int imin(int a, int b) { return (a < b ? a : b); }
static __inline long lmax(long a, long b) { return (a > b ? a : b); }
static __inline long lmin(long a, long b) { return (a < b ? a : b); }
#ifdef max
#undef max
#endif//max
#ifdef min
#undef min
#endif//min
static __inline u_int max(u_int a, u_int b) { return (a > b ? a : b); }
static __inline u_int min(u_int a, u_int b) { return (a < b ? a : b); }
static __inline quad_t qmax(quad_t a, quad_t b) { return (a > b ? a : b); }

View file

@ -328,6 +328,9 @@ extern struct kmembuckets bucket[];
#ifndef __REACTOS__
extern void *malloc __P((unsigned long size, ...));
extern void free __P((void *addr, ...));
#else
#define malloc fbsd_malloc
#define free fbsd_free
#endif
#endif /* KERNEL */
#endif /* !_SYS_MALLOC_H_ */

View file

@ -365,6 +365,7 @@ union mcluster {
} \
(n) = (m)->m_next; \
FREE((m), mbtypes[(m)->m_type]); \
m = NULL; \
}
#else /* notyet */
#ifdef OSKIT
@ -376,6 +377,7 @@ union mcluster {
} \
(nn) = (m)->m_next; \
FREE((m), mbtypes[(m)->m_type]); \
m = NULL; \
}
#else /* !OSKIT */
#define MFREE(m, nn) \
@ -386,6 +388,7 @@ union mcluster {
} \
(nn) = (m)->m_next; \
FREE((m), mbtypes[(m)->m_type]); \
m = NULL; \
}
#endif /* OSKIT */
#endif

View file

@ -218,6 +218,7 @@
* For the scheduler to maintain a 1:1 mapping of CPU `tick' to `%age',
* FSHIFT must be at least 11; this gives us a maximum load avg of ~1024.
*/
#undef FSHIFT
#define FSHIFT 11 /* bits to right of fixed binary point */
#define FSCALE (1<<FSHIFT)

View file

@ -78,10 +78,12 @@
/*
* Structure used for manipulating linger option.
*/
#ifndef _WINSOCKAPI_
struct linger {
int l_onoff; /* option on/off */
int l_linger; /* linger time */
};
#endif//_WINSOCKAPI_
/*
* Level number for (get/set)sockopt() to apply to socket itself.
@ -93,7 +95,9 @@ struct linger {
*/
#define AF_UNSPEC 0 /* unspecified */
#define AF_LOCAL 1 /* local to host (pipes, portals) */
#ifndef _WINSOCKAPI_
#define AF_UNIX AF_LOCAL /* backward compatibility */
#endif//_WINSOCKAPI_
#define AF_INET 2 /* internetwork: UDP, TCP, etc. */
#define AF_IMPLINK 3 /* arpanet imp addresses */
#define AF_PUP 4 /* pup protocols: e.g. BSP */
@ -116,20 +120,30 @@ struct linger {
#define AF_COIP 20 /* connection-oriented IP, aka ST II */
#define AF_CNT 21 /* Computer Network Technology */
#define pseudo_AF_RTIP 22 /* Help Identify RTIP packets */
#ifndef _WINSOCKAPI_
#define AF_IPX 23 /* Novell Internet Protocol */
#endif//_WINSOCKAPI_
#define AF_SIP 24 /* Simple Internet Protocol */
#define pseudo_AF_PIP 25 /* Help Identify PIP packets */
#define AF_ISDN 26 /* Integrated Services Digital Network*/
#define AF_E164 AF_ISDN /* CCITT E.164 recommendation */
#define pseudo_AF_KEY 27 /* Internal key-management function */
#ifndef _WINSOCKAPI_
#define AF_INET6 28 /* IPv6 */
#define AF_MAX 29
#endif//_WINSOCKAPI_
/*
* Structure used by kernel to store most
* addresses.
*/
#ifdef _WINSOCKAPI_
#define sockaddr bsd_sockaddr
#define sockproto bsd_sockproto
#endif//_WINSOCKAPI_
struct sockaddr {
u_char sa_len; /* total length */
u_char sa_family; /* address family */
@ -150,14 +164,18 @@ struct sockproto {
*/
#define PF_UNSPEC AF_UNSPEC
#define PF_LOCAL AF_LOCAL
#ifndef _WINSOCKAPI_
#define PF_UNIX PF_LOCAL /* backward compatibility */
#endif//_WINSOCKAPI_
#define PF_INET AF_INET
#define PF_IMPLINK AF_IMPLINK
#define PF_PUP AF_PUP
#define PF_CHAOS AF_CHAOS
#define PF_NS AF_NS
#define PF_ISO AF_ISO
#ifndef _WINSOCKAPI_
#define PF_OSI AF_ISO
#endif//_WINSOCKAPI_
#define PF_ECMA AF_ECMA
#define PF_DATAKIT AF_DATAKIT
#define PF_CCITT AF_CCITT
@ -242,7 +260,9 @@ struct sockproto {
/*
* Maximum queue length specifiable by listen.
*/
#ifndef _WINSOCKAPI_
#define SOMAXCONN 128
#endif//_WINSOCKAPI_
/*
* Message header for recvmsg and sendmsg calls.

View file

@ -68,6 +68,7 @@ struct ostat {
};
#endif /* !_POSIX_SOURCE */
//#ifndef _MSC_VER
struct stat {
dev_t st_dev; /* inode's device */
ino_t st_ino; /* inode's number */
@ -87,6 +88,7 @@ struct stat {
long st_lspare;
quad_t st_qspare[2];
};
//#endif//_MSC_VER
#define st_atime st_atimespec.ts_sec
#define st_mtime st_mtimespec.ts_sec
#define st_ctime st_ctimespec.ts_sec

View file

@ -124,7 +124,20 @@ void printf __P((const char *, ...));
#else
#include <oskitfreebsd.h>
#include <oskitdebug.h>
#define log(x,...) OS_DbgPrint(x,(__VA_ARGS__))
int __cdecl vprintf(const char *, va_list);
static inline int log ( int blah, const char* fmt, ... )
{
va_list arg;
int i;
va_start(arg, fmt);
#ifndef __NTDRIVER__
i = vprintf ( fmt, arg );
#endif
va_end(arg);
return i;
}
#endif
void uprintf __P((const char *, ...));
int sprintf __P((char *buf, const char *, ...));

View file

@ -40,11 +40,12 @@
* Structure returned by gettimeofday(2) system call,
* and used in other calls.
*/
#ifndef _WINSOCKAPI_
struct timeval {
long tv_sec; /* seconds */
long tv_usec; /* and microseconds */
};
#endif//_WINSOCKAPI_
/*
* Structure defined by POSIX.4 to be like a timeval.
*/
@ -77,10 +78,12 @@ struct timezone {
/* Operations on timevals. */
#define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0
#define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
#ifndef _MSC_VER
#define timercmp(tvp, uvp, cmp) \
(((tvp)->tv_sec == (uvp)->tv_sec) ? \
((tvp)->tv_usec cmp (uvp)->tv_usec) : \
((tvp)->tv_sec cmp (uvp)->tv_sec))
#endif
/*
* Names of the interval timers, and structure

View file

@ -54,19 +54,33 @@ typedef unsigned long u_long;
typedef unsigned short ushort; /* Sys V compatibility */
typedef unsigned int uint; /* Sys V compatibility */
#ifdef _MSC_VER
typedef unsigned __int64 u_quad_t; /* quads */
typedef __int64 quad_t;
#else
typedef unsigned long long u_quad_t; /* quads */
typedef long long quad_t;
#endif/*_MSC_VER*/
typedef quad_t * qaddr_t;
typedef char * caddr_t; /* core address */
typedef long daddr_t; /* disk address */
#ifndef _DEV_T_DEFINED
#define _DEV_T_DEFINED
typedef unsigned long dev_t; /* device number */
#endif//_DEV_T_DEFINED
typedef unsigned long fixpt_t; /* fixed point number */
typedef unsigned long gid_t; /* group id */
#ifndef _INO_T_DEFINED
#define _INO_T_DEFINED
typedef unsigned long ino_t; /* inode number */
#endif//_INO_T_DEFINED
typedef unsigned short mode_t; /* permissions */
typedef unsigned short nlink_t; /* link count */
#ifndef _OFF_T_DEFINED
#define _OFF_T_DEFINED
typedef quad_t off_t; /* file offset */
#endif//_OFF_T_DEFINED
typedef long pid_t; /* process id */
typedef long segsz_t; /* segment size */
typedef long swblk_t; /* swap offset */
@ -99,11 +113,13 @@ __END_DECLS
#include <machine/types.h>
#ifdef _BSD_CLOCK_T_
#define _CLOCK_T_DEFINED
typedef _BSD_CLOCK_T_ clock_t;
#undef _BSD_CLOCK_T_
#endif
#ifdef _BSD_SIZE_T_
#define _SIZE_T_DEFINED
typedef _BSD_SIZE_T_ size_t;
#undef _BSD_SIZE_T_
#endif
@ -114,6 +130,7 @@ typedef _BSD_SSIZE_T_ ssize_t;
#endif
#ifdef _BSD_TIME_T_
#define _TIME_T_DEFINED
typedef _BSD_TIME_T_ time_t;
#undef _BSD_TIME_T_
#endif
@ -138,6 +155,7 @@ typedef long fd_mask;
#define howmany(x, y) (((x)+((y)-1))/(y))
#endif
#ifndef _MSC_VER
typedef struct fd_set {
fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)];
} fd_set;
@ -147,6 +165,7 @@ typedef struct fd_set {
#define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))
#define FD_COPY(f, t) bcopy(f, t, sizeof(*(f)))
#define FD_ZERO(p) bzero(p, sizeof(*(p)))
#endif/*_MSC_VER*/
#if defined(__STDC__) && defined(KERNEL)
/*

View file

@ -33,7 +33,9 @@
#define OSK_DEBUG_CPOINT 0x00800000
#define OSK_DEBUG_ULTRA 0xFFFFFFFF
#ifndef _MSC_VER
#include <roscfg.h>
#endif/*_MSC_VER*/
#include <oskittypes.h>
#ifdef DBG
@ -85,8 +87,9 @@ extern OSK_UINT OskitDebugTraceLevel;
#endif /* DBG */
#ifndef _MSC_VER
#define assert(x) ASSERT(x)
#endif//_MSC_VER
#define assert_irql(x) ASSERT_IRQL(x)
#endif /* __OSKITDEBUG_H */

View file

@ -3,12 +3,31 @@
extern void oskittcp_die(const char *file, int line);
#ifdef _MSC_VER
#define DbgPrint printf
#define DbgVPrint vprintf
#else//_MSC_VER
#define printf DbgPrint
#endif//_MSC_VER
#define ovbcopy(x,y,z) bcopy(x,y,z)
void *memset( void *dest, int c, size_t count );
#define bzero(x,y) memset(x,0,y)
#define bcopy(src,dst,n) memcpy(dst,src,n)
#ifdef _MSC_VER
static inline void panic ( const char* fmt, ... )
{
va_list arg;
va_start(arg, fmt);
DbgPrint ( "oskit PANIC: " );
DbgVPrint ( fmt, arg );
va_end(arg);
// TODO FIXME - print stack trace...
oskittcp_die("<unknown file>",-1);
}
#else//_MSC_VER
#define panic(...) do { DbgPrint(__VA_ARGS__); \
oskittcp_die(__FILE__,__LINE__); } while(0)
oskittcp_die(__FILE__,__LINE__); } while(0)
#endif//_MSC_VER
#define kmem_malloc(x,y,z) malloc(y)
#endif//_OSKITFREEBSD_H

View file

@ -1,7 +1,9 @@
#ifndef OSKITTCP_H
#define OSKITTCP_H
#ifndef _MSC_VER
#include <roscfg.h>
#endif/*_MSC_VER*/
#ifdef KERNEL
#include <sys/param.h>
#include <sys/systm.h>
@ -142,8 +144,14 @@ void OskitTCPGetAddress( void *socket,
#undef errno
#define malloc(x,...) fbsd_malloc(x,__FILE__,__LINE__)
#define free(x,...) fbsd_free(x,__FILE__,__LINE__)
void *fbsd_malloc( unsigned int bytes, ... );
void fbsd_free( void *data, ... );
#if 0
#define malloc(x) fbsd_malloc(x,__FILE__,__LINE__)
#define free(x) fbsd_free(x,__FILE__,__LINE__)
#endif
#define kern_malloc(x,y,z) kern_malloc_needs_definition(x,y,z)
#define kern_free(x,y,z) kern_free_needs_definition(x,w,z)
/* Error codes */
#include <oskiterrno.h>

View file

@ -1,6 +1,6 @@
# $Id: makefile,v 1.4 2004/08/29 20:04:42 arty Exp $
# $Id: makefile,v 1.5 2004/09/23 03:02:29 royce Exp $
PATH_TO_TOP = ../../..
@ -11,7 +11,7 @@ TARGET_TYPE = library
TARGET_NAME = oskittcp
#-DMEMTRACK
TARGET_CFLAGS = -g -D__REACTOS__=1 -DKERNEL -Iinclude/freebsd -Iinclude/freebsd/sys/include -Iinclude/freebsd/src/sys -Iinclude/freebsd/dev/include -Iinclude/freebsd/net/include -Iinclude -I$(PATH_TO_TOP)/w32api/include -I$(PATH_TO_TOP)/include
TARGET_CFLAGS = -g -D__REACTOS__=1 -D__NTDRIVER__ -DKERNEL -Iinclude/freebsd -Iinclude/freebsd/sys/include -Iinclude/freebsd/src/sys -Iinclude/freebsd/dev/include -Iinclude/freebsd/net/include -Iinclude -I$(PATH_TO_TOP)/w32api/include -I$(PATH_TO_TOP)/include
# require os code to explicitly request A/W version of structs/functions
TARGET_CFLAGS += -D_DISABLE_TIDENTS

View file

@ -26,3 +26,7 @@ documented parts of bsd. A wierd thing about sbappend is that it seems to
want to see an M_EOR flag at the end of the so->so_rcv->sb_mb chain. When
it gets there it should append the input chain.
=== NOTES FROM WORKING WITH ROYCE3 ===
tcp_output: between line 511 and 614 m is initialized. Where i was printing
it it didn't have data yet.

View file

@ -47,7 +47,7 @@ struct proc *
pfind(pid_t pid)
{
printf("%s called, pid=%d, returning x%p\n",
__FUNCTION__, (int)pid, (void*)&proc0);
"pfind", (int)pid, (void*)&proc0);
return &proc0;
}
@ -57,7 +57,7 @@ pfind(pid_t pid)
void
psignal (struct proc *p, int sig)
{
printf("%s called, proc=x%p sig=%d\n", __FUNCTION__, p, sig);
printf("%s called, proc=x%p sig=%d\n", "psignal", p, sig);
}
/*
@ -66,7 +66,7 @@ psignal (struct proc *p, int sig)
void
gsignal (int pgid, int sig)
{
printf("%s called, pgid=%d sig=%d\n", __FUNCTION__, pgid, sig);
printf("%s called, pgid=%d sig=%d\n", "gsignal", pgid, sig);
}
/* ---------------------------------------------------------------------- */

View file

@ -56,7 +56,7 @@
* This structure is used to keep track of in_multi chains which belong to
* deleted interface addresses.
*/
static LIST_HEAD(, multi_kludge) in_mk; /* XXX BSS initialization */
static LIST_HEAD(in_mk_type, multi_kludge) in_mk; /* XXX BSS initialization */
struct multi_kludge {
LIST_ENTRY(multi_kludge) mk_entry;

View file

@ -93,10 +93,10 @@ in_pcbbind(inp, nam)
u_short lport = 0;
int wild = 0, reuseport = (so->so_options & SO_REUSEPORT);
int error;
OS_DbgPrint(OSK_MID_TRACE,("Called\n"));
OskitDumpBuffer( nam->m_data, nam->m_len );
if( nam ) OskitDumpBuffer( nam->m_data, nam->m_len );
#ifndef __REACTOS__
if (in_ifaddr == 0) {

View file

@ -27,17 +27,15 @@ unsigned net_imask;
unsigned volatile ipending;
struct timeval boottime;
void *fbsd_malloc( unsigned int bytes, const char *file, int line, ... ) {
void *fbsd_malloc( unsigned int bytes, ... ) {
if( !OtcpEvent.TCPMalloc ) panic("no malloc");
return OtcpEvent.TCPMalloc
( OtcpEvent.ClientData,
(OSK_UINT)bytes, (OSK_PCHAR)file, (OSK_UINT)line );
( OtcpEvent.ClientData, (OSK_UINT)bytes, "*", 0 );
}
void fbsd_free( void *data, const char *file, int line, ... ) {
void fbsd_free( void *data, ... ) {
if( !OtcpEvent.TCPFree ) panic("no free");
OtcpEvent.TCPFree( OtcpEvent.ClientData,
data, (OSK_PCHAR)file, (OSK_UINT)line );
OtcpEvent.TCPFree( OtcpEvent.ClientData, data, "*", 0 );
}
void InitOskitTCP() {

View file

@ -880,7 +880,7 @@ ip_setmoptions(optname, imop, m)
* allocate one and initialize to default values.
*/
imo = (struct ip_moptions*)malloc(sizeof(*imo), M_IPMOPTS,
M_WAITOK);
M_WAITOK);
if (imo == NULL)
return (ENOBUFS);

View file

@ -136,7 +136,7 @@ long tk_rawcc;
}
int ticks;
volatile struct timeval time;
volatile struct timeval kern_time;
volatile struct timeval mono_time;
/*
@ -280,8 +280,8 @@ hzto(tv)
* 10ms ticks is 248 days.
*/
s = splclock();
sec = tv->tv_sec - time.tv_sec;
usec = tv->tv_usec - time.tv_usec;
sec = tv->tv_sec - kern_time.tv_sec;
usec = tv->tv_usec - kern_time.tv_usec;
splx(s);
if (usec < 0) {
sec--;

View file

@ -78,7 +78,7 @@ void clock_init()
{
timeout_init();
/* inittodr(0); // what does this do? */
boottime = time;
/* boottime = kern_time; */
/* Start a clock we can use for timeouts */
}

View file

@ -66,6 +66,10 @@
#include <netinet/tcpip.h>
#include <netinet/tcp_debug.h>
#ifdef _MSC_VER
unsigned long __stdcall GetTickCount();
#endif//_MSC_VER
#ifdef TCPDEBUG
int tcpconsdebug = 0;
#endif
@ -85,7 +89,11 @@ tcp_trace(act, ostate, tp, ti, req)
if (tcp_debx == TCP_NDEBUG)
tcp_debx = 0;
#ifdef _MSC_VER
td->td_time = GetTickCount();
#else
td->td_time = iptime();
#endif
td->td_act = act;
td->td_ostate = ostate;
td->td_tcb = (caddr_t)tp;

View file

@ -497,18 +497,17 @@ send:
}
m->m_data += max_linkhdr;
m->m_len = hdrlen;
/* m is not initialized here ... see below up to line
* in_cksum to see how it gets there */
if (len <= MHLEN - hdrlen - max_linkhdr) {
OS_DbgPrint(OSK_MID_TRACE,("Preparing %d bytes to send\n",
len));
OskitDumpBuffer(mtod(m, caddr_t), len);
m_copydata(so->so_snd.sb_mb, off, (int) len,
mtod(m, caddr_t) + hdrlen);
m->m_len += len;
} else {
m->m_next = m_copy(so->so_snd.sb_mb, off, (int) len);
OS_DbgPrint(OSK_MID_TRACE,("Preparing %d bytes to send\n",
len));
OskitDumpBuffer(mtod(m, caddr_t), len);
// the buffer is allocated, but not filled with the tcp
// header yet, so dumping it here yields garbage...
//OskitDumpBuffer(mtod(m, caddr_t), len);
if (m->m_next == 0) {
(void) m_free(m);
error = ENOBUFS;
@ -543,6 +542,9 @@ send:
m->m_len = hdrlen;
}
m->m_pkthdr.rcvif = (struct ifnet *)0;
/* This pulls the data ptr from m and start initting it...
* before this point, m is empty. */
ti = mtod(m, struct tcpiphdr *);
if (tp->t_template == 0)
panic("tcp_output");

View file

@ -352,8 +352,12 @@ m_copym(m, off0, len, wait)
n->m_data = m->m_data + off;
#ifdef OSKIT
oskit_bufio_addref(m->m_ext.ext_bufio);
#else
#ifdef __REACTOS__
m->m_data = malloc(m->m_len);
#else
mclrefcnt[mtocl(m->m_ext.ext_buf)]++;
#endif
#endif /* OSKIT */
n->m_ext = m->m_ext;
n->m_flags |= M_EXT;
@ -402,11 +406,7 @@ m_copydata(m, off, len, cp)
if (m == 0)
panic("m_copydata");
count = min(m->m_len - off, len);
#ifdef __REACTOS__
memcpy(cp, mtod(m, caddr_t) + off, count);
#else
bcopy(mtod(m, caddr_t) + off, cp, count);
#endif
OS_DbgPrint(OSK_MID_TRACE,("buf %x, len %d\n", m, count));
OskitDumpBuffer(m->m_data, count);
len -= count;

View file

@ -33,7 +33,9 @@
* @(#)uipc_socket.c 8.3 (Berkeley) 4/15/94
*/
#ifndef _MSC_VER
#include <roscfg.h>
#endif/*_MSC_VER*/
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/proc.h>