summaryrefslogtreecommitdiff
path: root/src/nu_lanman.c
blob: 3d78b069e16b29f539238cfc31d5ff4e2286fb61 (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
#include "nu_lanman.h"

BYTE LANMAN_NetShareGetInfo_1_params[] = { 10,6,0,20,0,0,0,6,0,55,0,0,0,20,0,61,0,0,0,0,0 };
BYTE LANMAN_NetShareGetInfo_1_bytes[]  = { 26,0,0,0,0,0,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 */
          data->params = (SMB_PARAMS*)LANMAN_NetShareGetInfo_1_params;
          data->bytes  = (SMB_BYTES*) LANMAN_NetShareGetInfo_1_bytes;
          break;
        default: /* Later */
          return 0x00400002;
          break;
      }
      break;
    }
    default:
      return 0x00400002;
  }
  return 0;
}