Changeset 503
- Timestamp:
- 05/14/08 00:02:22 (5 months ago)
- Location:
- Whitix/branches/hybrid/net
- Files:
-
- 1 added
- 1 removed
- 5 modified
Legend:
- Unmodified
- Added
- Removed
-
Whitix/branches/hybrid/net/Makefile
r236 r503 2 2 include ../make.inc 3 3 4 OBJS = local.o socket.o network.o device.o 4 MODULES = local.sys socket.sys network.sys device.sys eth.sys 5 5 6 build: $( OBJS)6 build: $(MODULES) 7 7 make -C inet 8 ld -r socket.sys network.sys device.sys eth.sys -o net.sys 9 10 modules_install: 11 make -C inet modules_install 12 cp net.sys local.sys ../CdRoot/System/Modules/Core 8 13 9 14 clean: 10 rm -f *.o 15 rm -f *.o *.sys 11 16 make -C inet clean -
Whitix/branches/hybrid/net/device.c
r247 r503 18 18 19 19 #include <init.h> 20 #include <module.h> 20 21 #include <net/network.h> 21 22 #include <slab.h> … … 31 32 } 32 33 34 SYMBOL_EXPORT(NetDeviceAlloc); 35 33 36 int NetDeviceRegister(struct NetDevice* device) 34 37 { … … 37 40 } 38 41 42 SYMBOL_EXPORT(NetDeviceRegister); 43 39 44 int NetDeviceInit() 40 45 { … … 42 47 return 0; 43 48 } 44 45 NetInit(NetDeviceInit); -
Whitix/branches/hybrid/net/inet/Makefile
r226 r503 2 2 include ../../make.inc 3 3 4 OBJS = eth.oipv4.o tcp.o4 OBJS = ipv4.o tcp.o 5 5 6 6 build: $(OBJS) 7 ld -r $(OBJS) -o inet.sys 8 9 modules_install: 10 cp inet.sys ../../CdRoot/System/Modules/Core 7 11 8 12 clean: -
Whitix/branches/hybrid/net/network.c
r230 r503 18 18 19 19 #include <console.h> 20 #include <init.h> 21 #include <module.h> 20 22 #include <net/socket.h> 21 23 #include <typedefs.h> … … 36 38 int NetworkInit() 37 39 { 40 printf("NETWORK: Initialising network stack.\n"); 41 42 EthInit(); 43 38 44 return SocketInit(); 45 return 0; 39 46 } 47 48 SubSysInit(NetworkInit); -
Whitix/branches/hybrid/net/socket.c
r333 r503 23 23 #include <fs/vfs.h> 24 24 #include <malloc.h> 25 #include <module.h> 25 26 #include <net/network.h> 26 27 #include <net/socket.h> … … 86 87 87 88 if (UNLIKELY(!file)) 88 return -EBADF;89 return; 89 90 90 91 file->vNode=NULL; … … 167 168 } 168 169 170 /* Make local-only? */ 169 171 int SocketDoAccept(struct Socket* server, struct Socket* client, struct Socket** child) 170 172 { … … 186 188 } 187 189 190 SYMBOL_EXPORT(SocketDoAccept); 191 188 192 struct SocketBuffer* SocketAllocateBuffer(const void* buffer, int length) 189 193 { … … 200 204 } 201 205 206 SYMBOL_EXPORT(SocketAllocateBuffer); 207 202 208 int SocketDestroyBuffer(struct SocketBuffer* sockBuff) 203 209 { … … 207 213 } 208 214 215 SYMBOL_EXPORT(SocketDestroyBuffer); 216 209 217 int SocketPoll(struct File* file, struct PollItem* item, struct PollQueue* pollQueue) 210 218 { … … 221 229 { 222 230 struct VMArea* base, *curr; 223 intverifiedLen=0;231 DWORD verifiedLen=0; 224 232 225 233 base=VmLookupAddress(current, (DWORD)buffer); … … 435 443 } 436 444 445 SYMBOL_EXPORT(SocketRegisterFamily); 446 447 #define NET_SYS_BASE 42 448 437 449 int SocketInit() 438 450 { … … 442 454 return -ENOMEM; 443 455 444 return 0; 445 } 446 456 /* Register system calls. */ 457 SysRegisterCall(NET_SYS_BASE+0, (DWORD)&SysSocketCreate); 458 SysRegisterCall(NET_SYS_BASE+1, (DWORD)&SysSocketBind); 459 SysRegisterCall(NET_SYS_BASE+2, (DWORD)&SysSocketConnect); 460 SysRegisterCall(NET_SYS_BASE+3, (DWORD)&SysSocketListen); 461 SysRegisterCall(NET_SYS_BASE+4, (DWORD)&SysSocketAccept); 462 SysRegisterCall(NET_SYS_BASE+5, (DWORD)&SysSocketSend); 463 SysRegisterCall(NET_SYS_BASE+6, (DWORD)&SysSocketReceive); 464 SysRegisterCall(NET_SYS_BASE+7, (DWORD)&SysSocketIoCtl); 465 SysRegisterCall(NET_SYS_BASE+8, (DWORD)&SysSocketClose); 466 467 return 0; 468 } 469
