summaryrefslogtreecommitdiffstats
path: root/contrib/smbfs
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/smbfs')
-rw-r--r--contrib/smbfs/lib/smb/mbuf.c18
-rw-r--r--contrib/smbfs/lib/smb/nb_name.c8
-rw-r--r--contrib/smbfs/lib/smb/rap.c11
-rw-r--r--contrib/smbfs/smbutil/view.c9
4 files changed, 26 insertions, 20 deletions
diff --git a/contrib/smbfs/lib/smb/mbuf.c b/contrib/smbfs/lib/smb/mbuf.c
index 4980575..729b5c5 100644
--- a/contrib/smbfs/lib/smb/mbuf.c
+++ b/contrib/smbfs/lib/smb/mbuf.c
@@ -36,7 +36,7 @@
__FBSDID("$FreeBSD$");
#include <sys/types.h>
-#include <sys/mchain.h>
+#include <sys/endian.h>
#include <arpa/inet.h>
#include <ctype.h>
#include <errno.h>
@@ -268,7 +268,7 @@ int
mb_put_int64be(struct mbdata *mbp, int64_t x)
{
MB_PUT(int64_t);
- *p = htobeq(x);
+ *p = htobe64(x);
return 0;
}
@@ -276,7 +276,7 @@ int
mb_put_int64le(struct mbdata *mbp, int64_t x)
{
MB_PUT(int64_t);
- *p = htoleq(x);
+ *p = htole64(x);
return 0;
}
@@ -367,7 +367,7 @@ mb_get_uint16le(struct mbdata *mbp, u_int16_t *x)
u_int16_t v;
int error = mb_get_uint16(mbp, &v);
- *x = letohs(v);
+ *x = le16toh(v);
return error;
}
@@ -376,7 +376,7 @@ mb_get_uint16be(struct mbdata *mbp, u_int16_t *x) {
u_int16_t v;
int error = mb_get_uint16(mbp, &v);
- *x = betohs(v);
+ *x = be16toh(v);
return error;
}
@@ -393,7 +393,7 @@ mb_get_uint32be(struct mbdata *mbp, u_int32_t *x)
int error;
error = mb_get_uint32(mbp, &v);
- *x = betohl(v);
+ *x = be32toh(v);
return error;
}
@@ -404,7 +404,7 @@ mb_get_uint32le(struct mbdata *mbp, u_int32_t *x)
int error;
error = mb_get_uint32(mbp, &v);
- *x = letohl(v);
+ *x = le32toh(v);
return error;
}
@@ -421,7 +421,7 @@ mb_get_int64be(struct mbdata *mbp, int64_t *x)
int error;
error = mb_get_int64(mbp, &v);
- *x = betohq(v);
+ *x = be64toh(v);
return error;
}
@@ -432,7 +432,7 @@ mb_get_int64le(struct mbdata *mbp, int64_t *x)
int error;
error = mb_get_int64(mbp, &v);
- *x = letohq(v);
+ *x = le64toh(v);
return error;
}
diff --git a/contrib/smbfs/lib/smb/nb_name.c b/contrib/smbfs/lib/smb/nb_name.c
index 01500c3..ad34489 100644
--- a/contrib/smbfs/lib/smb/nb_name.c
+++ b/contrib/smbfs/lib/smb/nb_name.c
@@ -31,9 +31,13 @@
*
* $Id: nb_name.c,v 1.2 2001/08/22 03:31:36 bp Exp $
*/
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
#include <sys/param.h>
+#include <sys/endian.h>
#include <sys/socket.h>
-#include <sys/mchain.h> /* for endiand macros */
#include <ctype.h>
#include <err.h>
@@ -139,7 +143,7 @@ nb_encname_len(const char *str)
return len;
}
-#define NBENCODE(c) (htoles((u_short)(((u_char)(c) >> 4) | \
+#define NBENCODE(c) (htole16((u_short)(((u_char)(c) >> 4) | \
(((u_char)(c) & 0xf) << 8)) + 0x4141))
static void
diff --git a/contrib/smbfs/lib/smb/rap.c b/contrib/smbfs/lib/smb/rap.c
index e595bc1..19e803d 100644
--- a/contrib/smbfs/lib/smb/rap.c
+++ b/contrib/smbfs/lib/smb/rap.c
@@ -35,6 +35,7 @@
* This is very simple implementation of RAP protocol.
*/
#include <sys/param.h>
+#include <sys/endian.h>
#include <sys/errno.h>
#include <sys/stat.h>
#include <ctype.h>
@@ -45,8 +46,6 @@
#include <stdlib.h>
#include <sysexits.h>
-#include <sys/mchain.h>
-
#include <netsmb/smb_lib.h>
#include <netsmb/smb_conn.h>
#include <netsmb/smb_rap.h>
@@ -290,7 +289,7 @@ smb_rap_getNparam(struct smb_rap *rap, long *value)
return error;
switch (ptype) {
case 'h':
- *value = letohs(*(u_int16_t*)rap->r_npbuf);
+ *value = le16toh(*(u_int16_t*)rap->r_npbuf);
break;
default:
return EINVAL;
@@ -320,8 +319,8 @@ smb_rap_request(struct smb_rap *rap, struct smb_ctx *ctx)
if (error)
return error;
rp = (u_int16_t*)rap->r_pbuf;
- rap->r_result = letohs(*rp++);
- conv = letohs(*rp++);
+ rap->r_result = le16toh(*rp++);
+ conv = le16toh(*rp++);
rap->r_npbuf = (char*)rp;
rap->r_entries = entries = 0;
done = 0;
@@ -329,7 +328,7 @@ smb_rap_request(struct smb_rap *rap, struct smb_ctx *ctx)
ptype = *p;
switch (ptype) {
case 'e':
- rap->r_entries = entries = letohs(*(u_int16_t*)rap->r_npbuf);
+ rap->r_entries = entries = le16toh(*(u_int16_t*)rap->r_npbuf);
rap->r_npbuf += 2;
p++;
break;
diff --git a/contrib/smbfs/smbutil/view.c b/contrib/smbfs/smbutil/view.c
index 42450df..b8465df 100644
--- a/contrib/smbfs/smbutil/view.c
+++ b/contrib/smbfs/smbutil/view.c
@@ -31,6 +31,11 @@
*
* $Id: view.c,v 1.9 2002/02/20 09:26:42 bp Exp $
*/
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/endian.h>
#include <sys/param.h>
#include <sys/errno.h>
#include <sys/stat.h>
@@ -44,8 +49,6 @@
#include <cflib.h>
-#include <sys/mchain.h>
-
#include <netsmb/smb_lib.h>
#include <netsmb/smb_conn.h>
#include <netsmb/smb_rap.h>
@@ -113,7 +116,7 @@ cmd_view(int argc, char *argv[])
exit(1);
}
for (ep = rpbuf, i = 0; i < entries; i++, ep++) {
- type = letohs(ep->shi1_type);
+ type = le16toh(ep->shi1_type);
cp = (char*)rpbuf + ep->shi1_remark;
printf("%-12s %-10s %s\n", ep->shi1_netname,
OpenPOWER on IntegriCloud