summaryrefslogtreecommitdiff
path: root/src/nu_server.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nu_server.c')
-rwxr-xr-xsrc/nu_server.c41
1 files changed, 23 insertions, 18 deletions
diff --git a/src/nu_server.c b/src/nu_server.c
index 186c2d7..5112f1e 100755
--- a/src/nu_server.c
+++ b/src/nu_server.c
@@ -91,30 +91,35 @@ static SMB_STATUS handle_SMB_COM_TREE_CONNECT_ANDX( SMB_HEADER *header, SMB_DATA
91 return STATUS_SUCCESS; 91 return STATUS_SUCCESS;
92} 92}
93 93
94static SMB_STATUS handle_SMB_COM_TRANSACTION( SMB_HEADER *header, SMB_DATA *data ) { 94//static SMB_STATUS handle_SMB_COM_TRANSACTION( SMB_HEADER *header, SMB_DATA *data ) {
95 if( !strcmp( (char*)&data->bytes[1], "\\PIPE\\LANMAN")) 95// if( !strcmp( (char*)&data->bytes[1], "\\PIPE\\LANMAN"))
96 { 96// {
97 /* TODO: Sanity Check on DataCount vs. ByteCount */ 97// /* TODO: Sanity Check on DataCount vs. ByteCount */
98 SMB_PARAMS_TRANSACTION *params = (SMB_PARAMS_TRANSACTION *)data->params; 98// SMB_PARAMS_TRANSACTION *params = (SMB_PARAMS_TRANSACTION *)data->params;
99 SMB_TRANSACTION_BYTES bytes; 99// SMB_TRANSACTION_BYTES bytes;
100 100//
101 bytes.params = ((BYTE*)&header->Protocol) + GETNWORD( params->ParameterOffset ); 101// bytes.params = ((BYTE*)&header->Protocol) + GETNWORD( params->ParameterOffset );
102 bytes.paramc = GETNWORD( params->ParameterCount ); 102// bytes.paramc = GETNWORD( params->ParameterCount );
103 bytes.data = ((BYTE*)&header->Protocol) + GETNWORD( params->DataOffset ); 103// bytes.data = ((BYTE*)&header->Protocol) + GETNWORD( params->DataOffset );
104 bytes.datac = GETNWORD( params->DataCount ); 104// bytes.datac = GETNWORD( params->DataCount );
105 105//
106 return handle_LANMAN( header, data, &bytes ); 106// return handle_LANMAN( header, data, &bytes );
107 } 107// }
108 else 108// else
109 return 0x00400002; 109// return 0x00400002;
110} 110//}
111
112//static SMB_STATUS handle_SMB_COM_TRANSACTION2( SMB_HEADER *header, SMB_DATA *data ) {
113// return 0x00400002; /* No handler yet */
114//}
111 115
112static int command_handler_match(const void *a, const void *b ) { return *(BYTE*)a - *(BYTE*)b; } 116static int command_handler_match(const void *a, const void *b ) { return *(BYTE*)a - *(BYTE*)b; }
113 117
114/* If you add command handlers, please insert them in the right position, 118/* If you add command handlers, please insert them in the right position,
115 this list is sorted by command, for later bsearch*/ 119 this list is sorted by command, for later bsearch*/
116static SMB_COMMAND_HANDLER command_handler[] = { 120static SMB_COMMAND_HANDLER command_handler[] = {
117 { SMB_COM_TRANSACTION, 0x00, handle_SMB_COM_TRANSACTION }, 121// { SMB_COM_TRANSACTION, 0x00, handle_SMB_COM_TRANSACTION },
122// { SMB_COM_TRANSACTION2, 0x00, handle_SMB_COM_TRANSACTION2 },
118 { SMB_COM_NEGOTIATE, 0x00, handle_SMB_COM_NEGOTIATE }, 123 { SMB_COM_NEGOTIATE, 0x00, handle_SMB_COM_NEGOTIATE },
119 { SMB_COM_SESSION_SETUP_ANDX, 0x01, handle_SMB_COM_SESSION_SETUP_ANDX }, 124 { SMB_COM_SESSION_SETUP_ANDX, 0x01, handle_SMB_COM_SESSION_SETUP_ANDX },
120 { SMB_COM_TREE_CONNECT_ANDX, 0x01, handle_SMB_COM_TREE_CONNECT_ANDX } 125 { SMB_COM_TREE_CONNECT_ANDX, 0x01, handle_SMB_COM_TREE_CONNECT_ANDX }