Some net headers fixes

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1911 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Philippe Houdoin
2002-11-13 07:57:19 +00:00
parent 7eae9afc01
commit 40e492bc4c
4 changed files with 49 additions and 59 deletions
+38 -40
View File
@@ -41,53 +41,53 @@ class NLPacket;
class BNetBuffer : public BArchivable class BNetBuffer : public BArchivable
{ {
public: public:
BNetBuffer( size_t size = 0 ); BNetBuffer(size_t size = 0);
virtual ~BNetBuffer( void ); virtual ~BNetBuffer();
status_t InitCheck( void ); status_t InitCheck();
BNetBuffer( BMessage* Archive ); BNetBuffer(BMessage *archive);
virtual status_t Archive( BMessage* into, bool deep = true ) const; virtual status_t Archive(BMessage *into, bool deep = true) const;
static BArchivable* Instantiate( BMessage* archive ); static BArchivable *Instantiate(BMessage *archive);
BNetBuffer( const BNetBuffer& ); BNetBuffer(const BNetBuffer &);
BNetBuffer& operator=( const BNetBuffer& ); BNetBuffer& operator=(const BNetBuffer &);
// Mutators. // Mutators.
status_t AppendInt8( int8 ); status_t AppendInt8(int8);
status_t AppendUint8( uint8 ); status_t AppendUint8(uint8);
status_t AppendInt16( int16 ); status_t AppendInt16(int16);
status_t AppendUint16( uint16 ); status_t AppendUint16(uint16);
status_t AppendInt32( int32 ); status_t AppendInt32(int32);
status_t AppendUint32( uint32 ); status_t AppendUint32(uint32);
status_t AppendFloat( float ); status_t AppendFloat(float);
status_t AppendDouble( double ); status_t AppendDouble(double);
status_t AppendString( const char* ); status_t AppendString(const char *);
status_t AppendData( const void*, size_t ); status_t AppendData(const void *, size_t);
status_t AppendMessage( const BMessage& ); status_t AppendMessage(const BMessage &);
status_t AppendInt64( int64 ); status_t AppendInt64(int64);
status_t AppendUint64( uint64 ); status_t AppendUint64(uint64);
status_t RemoveInt8( int8& ); status_t RemoveInt8(int8 &);
status_t RemoveUint8( uint8& ); status_t RemoveUint8(uint8 &);
status_t RemoveInt16( int16& ); status_t RemoveInt16(int16 &);
status_t RemoveUint16( uint16& ); status_t RemoveUint16(uint16 &);
status_t RemoveInt32( int32& ); status_t RemoveInt32(int32 &);
status_t RemoveUint32( uint32& ); status_t RemoveUint32(uint32 &);
status_t RemoveFloat( float& ); status_t RemoveFloat(float &);
status_t RemoveDouble( double& ); status_t RemoveDouble(double &);
status_t RemoveString( char*, size_t ); status_t RemoveString(char *, size_t);
status_t RemoveData( void*, size_t ); status_t RemoveData(void *, size_t);
status_t RemoveMessage( BMessage& ); status_t RemoveMessage(BMessage &);
status_t RemoveInt64( int64& ); status_t RemoveInt64(int64 &);
status_t RemoveUint64( uint64& ); status_t RemoveUint64(uint64 &);
// Accessors. // Accessors.
unsigned char* Data( void ) const; unsigned char *Data() const;
size_t Size( void ) const; size_t Size() const;
size_t BytesRemaining( void ) const; size_t BytesRemaining() const;
inline NLPacket *GetImpl( void ) const; inline NLPacket *GetImpl() const;
protected: protected:
// Attributes. // Attributes.
@@ -117,5 +117,3 @@ inline NLPacket* BNetBuffer::GetImpl( void ) const
#endif // <-- #ifndef _NETBUFFER_H #endif // <-- #ifndef _NETBUFFER_H
/*=------------------------------------------------------------------- End -=*/
+2 -4
View File
@@ -46,13 +46,11 @@ public:
static bool IsEnabled(); static bool IsEnabled();
// print a debugging message // print a debugging message
static void Print( const char* msg ); static void Print(const char *msg);
// dump raw data in a nice hd-like format // dump raw data in a nice hd-like format
static void Dump( const char* data, size_t size, const char* title ); static void Dump(const char *data, size_t size, const char *title);
}; };
#endif // <-- #ifndef _NETDEBUG_H #endif // <-- #ifndef _NETDEBUG_H
/*=------------------------------------------------------------------- End -=*/
-15
View File
@@ -15,19 +15,7 @@
#include "net/if.h" #include "net/if.h"
#include "net/route.h" #include "net/route.h"
#ifdef _KERNEL_MODE
#include <module.h> #include <module.h>
#else
typedef struct module_info {
const char *name;
uint32 flags;
status_t (*std_ops)(int32, ...);
} module_info;
#define B_MODULE_INIT 1
#define B_MODULE_UNINIT 2
#define B_KEEP_LOADED 0x00000001
#endif
struct kernel_net_module_info { struct kernel_net_module_info {
module_info info; module_info info;
@@ -39,9 +27,6 @@ struct net_module {
struct net_module *next; struct net_module *next;
char *name; char *name;
struct kernel_net_module_info *ptr; struct kernel_net_module_info *ptr;
#ifndef _KERNEL_MODE
image_id iid;
#endif
int status; int status;
}; };
+9
View File
@@ -11,6 +11,9 @@
#include <OS.h> #include <OS.h>
#include "net_stack_driver.h" #include "net_stack_driver.h"
#ifdef __cplusplus
extern "C" {
#endif
#define NET_STACK_PORTNAME "net_server connection" #define NET_STACK_PORTNAME "net_server connection"
@@ -47,7 +50,13 @@ typedef struct {
uint32 numCommands,bufferSize; uint32 numCommands,bufferSize;
} net_connection; } net_connection;
extern status_t init_userland_ipc(void); extern status_t init_userland_ipc(void);
extern void shutdown_userland_ipc(void); extern void shutdown_userland_ipc(void);
#ifdef __cplusplus
} // end of extern "C"
#endif
#endif /* USERLAND_IPC_H */ #endif /* USERLAND_IPC_H */