nb_name.c (88283) | nb_name.c (150312) |
---|---|
1/* 2 * Copyright (c) 2000-2001, Boris Popov 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * 32 * $Id: nb_name.c,v 1.2 2001/08/22 03:31:36 bp Exp $ 33 */ | 1/* 2 * Copyright (c) 2000-2001, Boris Popov 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * 32 * $Id: nb_name.c,v 1.2 2001/08/22 03:31:36 bp Exp $ 33 */ |
34 35#include <sys/cdefs.h> 36__FBSDID("$FreeBSD: head/contrib/smbfs/lib/smb/nb_name.c 150312 2005-09-19 08:07:18Z imura $"); 37 |
|
34#include <sys/param.h> | 38#include <sys/param.h> |
39#include <sys/endian.h> |
|
35#include <sys/socket.h> | 40#include <sys/socket.h> |
36#include <sys/mchain.h> /* for endiand macros */ | |
37 38#include <ctype.h> 39#include <err.h> 40#include <errno.h> 41#include <stdio.h> 42#include <stdlib.h> 43#include <string.h> 44 --- 89 unchanged lines hidden (view full) --- 134 if (blen++ == 0) 135 break; 136 len += blen; 137 cp += blen; 138 } 139 return len; 140} 141 | 41 42#include <ctype.h> 43#include <err.h> 44#include <errno.h> 45#include <stdio.h> 46#include <stdlib.h> 47#include <string.h> 48 --- 89 unchanged lines hidden (view full) --- 138 if (blen++ == 0) 139 break; 140 len += blen; 141 cp += blen; 142 } 143 return len; 144} 145 |
142#define NBENCODE(c) (htoles((u_short)(((u_char)(c) >> 4) | \ | 146#define NBENCODE(c) (htole16((u_short)(((u_char)(c) >> 4) | \ |
143 (((u_char)(c) & 0xf) << 8)) + 0x4141)) 144 145static void 146memsetw(char *dst, int n, u_short word) 147{ 148 while (n--) { 149 *(u_short*)dst = word; 150 dst += 2; --- 49 unchanged lines hidden --- | 147 (((u_char)(c) & 0xf) << 8)) + 0x4141)) 148 149static void 150memsetw(char *dst, int n, u_short word) 151{ 152 while (n--) { 153 *(u_short*)dst = word; 154 dst += 2; --- 49 unchanged lines hidden --- |