Added missing socket functions

This commit is contained in:
Maschell 2017-11-11 15:48:41 +01:00
parent 9bc4dfe2d1
commit 71a7483d20
3 changed files with 14 additions and 0 deletions

View File

@ -18,6 +18,13 @@ typedef struct _OsSpecifics
unsigned int addr_KernSyscallTbl5; unsigned int addr_KernSyscallTbl5;
} OsSpecifics; } OsSpecifics;
typedef struct _s_mem_area
{
unsigned int address;
unsigned int size;
struct _s_mem_area* next;
} s_mem_area;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -32,6 +32,7 @@ EXPORT_DECL(s32, socket_lib_init, void);
EXPORT_DECL(s32, socket_lib_finish, void); EXPORT_DECL(s32, socket_lib_finish, void);
EXPORT_DECL(s32, socket, s32 domain, s32 type, s32 protocol); EXPORT_DECL(s32, socket, s32 domain, s32 type, s32 protocol);
EXPORT_DECL(s32, socketclose, s32 s); EXPORT_DECL(s32, socketclose, s32 s);
EXPORT_DECL(s32, shutdown, s32 s, s32 how);
EXPORT_DECL(s32, connect, s32 s, void *addr, s32 addrlen); EXPORT_DECL(s32, connect, s32 s, void *addr, s32 addrlen);
EXPORT_DECL(s32, bind, s32 s,struct sockaddr *name,s32 namelen); EXPORT_DECL(s32, bind, s32 s,struct sockaddr *name,s32 namelen);
EXPORT_DECL(s32, listen, s32 s,u32 backlog); EXPORT_DECL(s32, listen, s32 s,u32 backlog);
@ -75,6 +76,7 @@ void InitSocketFunctionPointers(void){
OS_FIND_EXPORT(nsysnet_handle, socketlasterr); OS_FIND_EXPORT(nsysnet_handle, socketlasterr);
OS_FIND_EXPORT(nsysnet_handle, socket); OS_FIND_EXPORT(nsysnet_handle, socket);
OS_FIND_EXPORT(nsysnet_handle, socketclose); OS_FIND_EXPORT(nsysnet_handle, socketclose);
OS_FIND_EXPORT(nsysnet_handle, shutdown);
OS_FIND_EXPORT(nsysnet_handle, connect); OS_FIND_EXPORT(nsysnet_handle, connect);
OS_FIND_EXPORT(nsysnet_handle, bind); OS_FIND_EXPORT(nsysnet_handle, bind);
OS_FIND_EXPORT(nsysnet_handle, listen); OS_FIND_EXPORT(nsysnet_handle, listen);

View File

@ -39,6 +39,10 @@ extern u32 hostIpAddress;
#define AF_INET 2 #define AF_INET 2
#define SHUT_RD 0
#define SHUT_WR 1
#define SHUT_RDWR 2
#define SOCK_STREAM 1 #define SOCK_STREAM 1
#define SOCK_DGRAM 2 #define SOCK_DGRAM 2
@ -87,6 +91,7 @@ extern s32 (*socket_lib_init)(void);
extern s32 (*socket_lib_finish)(void); extern s32 (*socket_lib_finish)(void);
extern s32 (*socket)(s32 domain, s32 type, s32 protocol); extern s32 (*socket)(s32 domain, s32 type, s32 protocol);
extern s32 (*socketclose)(s32 s); extern s32 (*socketclose)(s32 s);
extern s32 (*shutdown)(s32 s, s32 how);
extern s32 (*connect)(s32 s, void *addr, s32 addrlen); extern s32 (*connect)(s32 s, void *addr, s32 addrlen);
extern s32 (*bind)(s32 s,struct sockaddr *name,s32 namelen); extern s32 (*bind)(s32 s,struct sockaddr *name,s32 namelen);
extern s32 (*listen)(s32 s,u32 backlog); extern s32 (*listen)(s32 s,u32 backlog);