diff options
Diffstat (limited to 'src/nu_server.h')
| -rwxr-xr-x | src/nu_server.h | 47 |
1 files changed, 46 insertions, 1 deletions
diff --git a/src/nu_server.h b/src/nu_server.h index 4d6abaa..89fe2e9 100755 --- a/src/nu_server.h +++ b/src/nu_server.h | |||
| @@ -1,8 +1,23 @@ | |||
| 1 | #ifndef _NU_SERVER_H_ | ||
| 2 | #define _NU_SERVER_H_ | ||
| 3 | |||
| 4 | #include <time.h> | ||
| 5 | #include <fcntl.h> | ||
| 6 | #include <signal.h> | ||
| 7 | #include <sys/types.h> | ||
| 8 | #include <sys/socket.h> | ||
| 9 | #include <netinet/in.h> | ||
| 10 | #include <stdio.h> | ||
| 11 | #include <sys/ioctl.h> | ||
| 12 | |||
| 1 | typedef unsigned char BYTE; | 13 | typedef unsigned char BYTE; |
| 2 | typedef unsigned short WORD; | 14 | typedef unsigned short WORD; |
| 3 | typedef unsigned long DWORD; | 15 | typedef unsigned long DWORD; |
| 4 | typedef int64_t QWORD; | 16 | typedef int64_t QWORD; |
| 5 | 17 | ||
| 18 | #define SKIPSTRING( str ) ((BYTE*)(str)) + 1 + strlen( (str) ) | ||
| 19 | #define GETNWORD(addr) (*((BYTE*)(addr)) | 256 * ((BYTE*)(addr))[1] ) | ||
| 20 | |||
| 6 | #include "nu_defines.h" | 21 | #include "nu_defines.h" |
| 7 | #define SMB_MAXREQUESTS 16 | 22 | #define SMB_MAXREQUESTS 16 |
| 8 | 23 | ||
| @@ -34,11 +49,41 @@ typedef struct { | |||
| 34 | 49 | ||
| 35 | typedef struct { | 50 | typedef struct { |
| 36 | SMB_PARAMS *params; | 51 | SMB_PARAMS *params; |
| 37 | SMB_BYTES *bytes; | 52 | SMB_BYTES *bytes; |
| 38 | } SMB_DATA; | 53 | } SMB_DATA; |
| 39 | 54 | ||
| 40 | typedef struct { | 55 | typedef struct { |
| 56 | BYTE WordCount; /* 19 + SetupCount */ | ||
| 57 | BYTE TotalParameterCount [2]; | ||
| 58 | BYTE TotalDataCount [2]; | ||
| 59 | BYTE MaxParameterCount [2]; /* For now we only support packets */ | ||
| 60 | BYTE MaxDataCount [2]; /* with TotalXXCount == MaxXXCount */ | ||
| 61 | BYTE MaxSetupCount; | ||
| 62 | BYTE Reserved; | ||
| 63 | BYTE Flags [2]; | ||
| 64 | BYTE Timeout [4]; | ||
| 65 | BYTE Reserved2 [2]; | ||
| 66 | |||
| 67 | BYTE ParameterCount [2]; | ||
| 68 | BYTE ParameterOffset [2]; | ||
| 69 | BYTE DataCount [2]; | ||
| 70 | BYTE DataOffset [2]; | ||
| 71 | BYTE SetupCount; | ||
| 72 | BYTE Reserved3; | ||
| 73 | BYTE Setup[0]; | ||
| 74 | } SMB_PARAMS_TRANSACTION; | ||
| 75 | |||
| 76 | typedef struct { | ||
| 77 | BYTE *params; | ||
| 78 | DWORD paramc; | ||
| 79 | BYTE *data; | ||
| 80 | DWORD datac; | ||
| 81 | } SMB_TRANSACTION_BYTES; | ||
| 82 | |||
| 83 | typedef struct { | ||
| 41 | BYTE cmd; | 84 | BYTE cmd; |
| 42 | SMB_COMMAND_FLAG flags; | 85 | SMB_COMMAND_FLAG flags; |
| 43 | SMB_STATUS (*handler)(SMB_HEADER *header, SMB_DATA *data); | 86 | SMB_STATUS (*handler)(SMB_HEADER *header, SMB_DATA *data); |
| 44 | } SMB_COMMAND_HANDLER; | 87 | } SMB_COMMAND_HANDLER; |
| 88 | |||
| 89 | #endif | ||
