summaryrefslogtreecommitdiff
path: root/src/nu_server.h
blob: 0a2ecc203372b32a130ace46b96c3315335582af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
typedef unsigned char  BYTE;
typedef unsigned short WORD;
typedef unsigned long  DWORD;
typedef int64_t        QWORD;

#include "nu_defines.h"

typedef struct {
  BYTE       netbios_command;
  BYTE       netbios_flags;
  WORD       netbios_size;
  DWORD      Protocol;     /* Protocol identifier 0xFF,"SMB" */
  BYTE       Command;      /* Command Code, look below */
  BYTE       Status[4];
  BYTE       Flags;
  WORD       Flags2;
  WORD       Pad[6];       /* Ensure 12 bytes len */
  WORD       TreeID;
  WORD       ProcessID;
  WORD       UserID;
  WORD       MultiplexID;
} SMB_HEADER;

typedef struct {
  BYTE       WordCount;
  WORD       Buffer[0];
} SMB_PARAMS;

typedef struct {
  WORD       ByteCount;
  BYTE       Buffer[0];
} SMB_BYTES;

typedef struct {
  SMB_PARAMS *params;
  SMB_BYTES *bytes;
} SMB_DATA;

typedef struct {
  SMB_COMMAND      cmd;
  SMB_COMMAND_FLAG flags;
  SMB_STATUS     (*handler)(SMB_DATA *data);
} SMB_COMMAND_HANDLER;