58 char *SMB_DOSTimToStr(
int DOS_time);
71 void SMB_Print_Pkt(FILE fd,
RFCNB_Pkt *pkt,
BOOL command,
int Offset,
int Len)
91 char *SMB_DOSTimToStr(
int DOS_time)
94 static char SMB_Time_Temp[48];
95 int DOS_sec, DOS_min, DOS_hour, DOS_day, DOS_month, DOS_year;
99 DOS_sec = (DOS_time & 0x001F) * 2;
100 DOS_min = (DOS_time & 0x07E0) >> 5;
101 DOS_hour = ((DOS_time & 0xF800) >> 11);
103 DOS_day = (DOS_time & 0x001F0000) >> 16;
104 DOS_month = (DOS_time & 0x01E00000) >> 21;
105 DOS_year = ((DOS_time & 0xFE000000) >> 25) + 80;
107 snprintf(SMB_Time_Temp, 48,
"%2d/%02d/%2d %2d:%02d:%02d", DOS_day, DOS_month,
108 DOS_year, DOS_hour, DOS_min, DOS_sec);
110 return(SMB_Time_Temp);
121 static char SMB_Attrib_Temp[128];
123 SMB_Attrib_Temp[0] = 0;
126 strcat(SMB_Attrib_Temp, (
verbose?
"Read Only ":
"R"));
129 strcat(SMB_Attrib_Temp, (
verbose?
"Hidden ":
"H"));
132 strcat(SMB_Attrib_Temp, (
verbose?
"System ":
"S"));
135 strcat(SMB_Attrib_Temp, (
verbose?
"Volume ":
"V"));
138 strcat(SMB_Attrib_Temp, (
verbose?
"Directory ":
"D"));
141 strcat(SMB_Attrib_Temp, (
verbose?
"Archive ":
"A"));
143 return(SMB_Attrib_Temp);
164 if (Con_Handle !=
NULL) {
165 return(Con_Handle -> max_xmit);
176 if (Con_Handle !=
NULL) {
177 return(Con_Handle -> prot_IDX);
190 if (Con_Handle !=
NULL) {
191 return(Con_Handle -> protocol);
209 int ourType = (prot_index < 0 || prot_index > 11);
218 if (strcmp(dialects[prot_index],
SMB_Prots[i]) == 0) {
245 int prots_len, i, pkt_len, prot, alloc_len;
252 for (i = 0; Prots[i] !=
NULL; i++) {
254 prots_len = prots_len + strlen(Prots[i]) + 2;
302 for (i = 0; Prots[i] !=
NULL; i++) {
305 strcpy(p + 1, Prots[i]);
306 p = p + strlen(Prots[i]) + 2;
312 if (
RFCNB_Send(Con_Handle -> Trans_Connect, pkt, pkt_len) < 0) {
315 fprintf(stderr,
"Error sending negotiate protocol\n");
326 if (
RFCNB_Recv(Con_Handle -> Trans_Connect, pkt, alloc_len) < 0) {
329 fprintf(stderr,
"Error receiving response to negotiate\n");
341 fprintf(stderr,
"SMB_Negotiate failed with errorclass = %i, Error Code = %i\n",
356 fprintf(stderr,
"None of our protocols was accepted ... ");
404 xstrncpy(p, Con_Handle -> Svr_PDom,
sizeof(Con_Handle -> Svr_PDom));