From 4c7e1fff2f2da39429f3f119868bb811629d9849 Mon Sep 17 00:00:00 2001 From: beveloper Date: Tue, 22 Oct 2002 16:29:21 +0000 Subject: [PATCH] Should help with compiling network related apps. I'm not sure if we really need this socket.h and netdb.h wrappers git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1599 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/os/net/net_settings.h | 62 +++++++++++++++++++++++++++++++++++ headers/os/net/netdb.h | 6 ++++ headers/os/net/socket.h | 14 ++++++++ 3 files changed, 82 insertions(+) create mode 100644 headers/os/net/net_settings.h create mode 100644 headers/os/net/netdb.h create mode 100644 headers/os/net/socket.h diff --git a/headers/os/net/net_settings.h b/headers/os/net/net_settings.h new file mode 100644 index 0000000000..0e2d3529e9 --- /dev/null +++ b/headers/os/net/net_settings.h @@ -0,0 +1,62 @@ +/******************************************************************************* +/ +/ File: net_settings.h +/ +/ Description: Network preferences settings. +/ +/ Copyright 1993-98, Be Incorporated, All Rights Reserved. +/ +*******************************************************************************/ + +#ifndef _NET_SETTINGS_H +#define _NET_SETTINGS_H + +#include +#include + +#if __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* + * Private types + */ +typedef struct _ns_entry { + const char *key; + const char *value; +} _ns_entry_t; + +typedef struct _ns_section { + const char *heading; + unsigned nentries; + _ns_entry_t *entries; +} _ns_section_t; + + +/* + * Public type, but the data members are private + */ +typedef struct _net_settings { + int _dirty; + unsigned _nsections; + _ns_section_t *_sections; + char _fname[64]; +} net_settings; + +/* + * For finding and setting network preferences + */ +extern _IMPEXP_NET +char *find_net_setting(net_settings *ncw, + const char *heading, const char *name, char *value, + unsigned nbytes); +extern _IMPEXP_NET +status_t set_net_setting(net_settings *ncw, + const char *heading, const char *name, + const char *value); + +#if __cplusplus +} +#endif /* __cplusplus */ + +#endif /* _NET_SETTINGS_H */ diff --git a/headers/os/net/netdb.h b/headers/os/net/netdb.h new file mode 100644 index 0000000000..739bd8d2e0 --- /dev/null +++ b/headers/os/net/netdb.h @@ -0,0 +1,6 @@ +#ifndef _NET_NETDB_H +#define _NET_NETDB_H + +#include /* should include the posix netdb.h */ + +#endif /* _NETDB_H */ diff --git a/headers/os/net/socket.h b/headers/os/net/socket.h new file mode 100644 index 0000000000..274c0a58a2 --- /dev/null +++ b/headers/os/net/socket.h @@ -0,0 +1,14 @@ +#ifndef _NET_SOCKET_H +#define _NET_SOCKET_H + +#include +#include /* in_addr, sockaddr_in */ +#include /* sockaddr */ +#include + +/* + * Be extension + */ +#define B_UDP_MAX_SIZE (65536 - 1024) + +#endif /* _SOCKET_H */