From 96027bb8637c00799a25391fd9804e7e030fed20 Mon Sep 17 00:00:00 2001 From: erdgeist <> Date: Thu, 26 Feb 2004 04:59:25 +0000 Subject: Introducing LANMAN functionality --- src/nu_lanman.c | 27 +++++++++++++++++++++++++++ src/nu_lanman.h | 8 ++++++++ 2 files changed, 35 insertions(+) create mode 100644 src/nu_lanman.c create mode 100644 src/nu_lanman.h diff --git a/src/nu_lanman.c b/src/nu_lanman.c new file mode 100644 index 0000000..0ab935e --- /dev/null +++ b/src/nu_lanman.c @@ -0,0 +1,27 @@ +#include "nu_lanman.h" + +BYTE LANMAN_NetShareGetInfo_1_bytes[] = { 20,0,'S','H','A','R','E',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; + +SMB_STATUS handle_LANMAN( SMB_HEADER *header, SMB_DATA *data, SMB_TRANSACTION_BYTES *bytes ) { + switch( GETNWORD( bytes->params ) ) { + case 1: /* NetShareGetInfo */ + { + BYTE *type = SKIPSTRING( 2 + bytes->params ); /* Input format string; should be "zWrLh" */ + type = SKIPSTRING( type ); /* Ouput format string; should be "B13", "B13BWz" or "B13BWzWWWzB9B"*/ + type = SKIPSTRING( type ); /* Name of the requested Share */ + + switch( GETNWORD(type)) { + case 1: /* Medium set of information */ + memcpy( bytes->params, LANMAN_NetShareGetInfo_1_bytes, sizeof( LANMAN_NetShareGetInfo_1_bytes )); /* possible buffer overflow */ + break; + default: /* Later */ + return 0x00400002; + break; + } + break; + } + default: + return 0x00400002; + } + return 0; +} diff --git a/src/nu_lanman.h b/src/nu_lanman.h new file mode 100644 index 0000000..f15c37a --- /dev/null +++ b/src/nu_lanman.h @@ -0,0 +1,8 @@ +#ifndef _NU_LANMAN_H_ +#define _NU_LANMAN_H_ + +#include "nu_server.h" + +SMB_STATUS handle_LANMAN( SMB_HEADER *header, SMB_DATA *data, SMB_TRANSACTION_BYTES *bytes ); + +#endif -- cgit v1.2.3