X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/48345fa3a4a29fb3002f34162550347123de916b..dff10c7f70d539c431a1eba9ab5e076d8b0f5c8e:/smbutil.c diff --git a/smbutil.c b/smbutil.c index 11de719c..c822d72d 100644 --- a/smbutil.c +++ b/smbutil.c @@ -5,6 +5,15 @@ BSD-style license that accompanies tcpdump or the GNU GPL version 2 or later */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#ifndef lint +static const char rcsid[] = + "@(#) $Header: /tcpdump/master/tcpdump/smbutil.c,v 1.6 2000-01-17 06:24:27 itojun Exp $"; +#endif + #include #include #include @@ -20,6 +29,7 @@ #include #include +#include "interface.h" #include "smb.h" extern uchar *startbuf; @@ -45,7 +55,7 @@ static void interpret_dos_date(uint32 date,int *year,int *month,int *day,int *ho /******************************************************************* create a unix date from a dos date ********************************************************************/ -time_t make_unix_date(void *date_ptr) +static time_t make_unix_date(const void *date_ptr) { uint32 dos_date=0; struct tm t; @@ -66,7 +76,7 @@ time_t make_unix_date(void *date_ptr) /******************************************************************* create a unix date from a dos date ********************************************************************/ -time_t make_unix_date2(void *date_ptr) +static time_t make_unix_date2(const void *date_ptr) { uint32 x,x2; @@ -81,7 +91,7 @@ time_t make_unix_date2(void *date_ptr) interpret an 8 byte "filetime" structure to a time_t It's originally in "100ns units since jan 1st 1601" ****************************************************************************/ -time_t interpret_long_date(char *p) +static time_t interpret_long_date(const char *p) { double d; time_t ret; @@ -154,7 +164,6 @@ extract a netbios name from a buf static int name_extract(char *buf,int ofs,char *name) { char *p = name_ptr(buf,ofs); - int d = PTR_DIFF(p,buf+ofs); strcpy(name,""); return(name_interpret(p,name)); } @@ -163,9 +172,9 @@ static int name_extract(char *buf,int ofs,char *name) /**************************************************************************** return the total storage length of a mangled name ****************************************************************************/ -static int name_len(unsigned char *s) +static int name_len(const unsigned char *s) { - char *s0 = s; + const char *s0 = s; unsigned char c = *(unsigned char *)s; if ((c & 0xC0) == 0xC0) return(2); @@ -173,7 +182,7 @@ static int name_len(unsigned char *s) return(PTR_DIFF(s,s0)+1); } -void print_asc(unsigned char *buf,int len) +static void print_asc(const unsigned char *buf,int len) { int i; for (i=0;i