1 /* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 * or http://www.opensolaris.org/os/licensing. 10 * See the License for the specific language governing permissions 11 * and limitations under the License. 12 * 13 * When distributing Covered Code, include this CDDL HEADER in each 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ 21 /* 22 * Copyright 2007 Sun Microsystems, Inc. All rights reserved. 23 * Use is subject to license terms. 24 */ 25 26 #ifndef _SMBSRV_SMB_INCL_H 27 #define _SMBSRV_SMB_INCL_H 28 29 #pragma ident "@(#)smb_incl.h 1.1 07/10/25 SMI" 30 31 #ifdef __cplusplus 32 extern "C" { 33 #endif 34 35 #include <sys/types.h> 36 #include <sys/param.h> 37 #include <sys/socket.h> 38 #include <sys/cmn_err.h> 39 #include <sys/cpuvar.h> 40 #include <sys/list.h> 41 #include <sys/sunddi.h> 42 #include <netinet/in_systm.h> 43 #include <netinet/in.h> 44 #include <netinet/ip.h> 45 #include <netinet/ip_icmp.h> 46 #include <netinet/ip_var.h> 47 #include <netinet/tcp.h> 48 #include <net/if.h> 49 #include <netinet/if_ether.h> 50 51 #include <sys/errno.h> 52 #include <sys/ioctl.h> 53 54 #include <smbsrv/alloc.h> 55 #include <smbsrv/ctype.h> 56 #include <smbsrv/string.h> 57 58 #include <smbsrv/ntstatus.h> 59 #include <smbsrv/nterror.h> 60 #include <smbsrv/doserror.h> 61 #include <smbsrv/cifs.h> 62 #include <smbsrv/ntaccess.h> 63 #include <smbsrv/smbinfo.h> 64 #include <smbsrv/smb.h> 65 66 #include <smbsrv/smbvar.h> 67 #include <smbsrv/smbfmt.h> 68 #include <smbsrv/smb_kproto.h> 69 70 #define QUEUE_INSERT_HEAD(q, e) \ 71 { \ 72 ((e)->forw) = (void *)((q)->forw); \ 73 ((e)->back) = (void *)(q); \ 74 ((q)->forw->back) = (void *)(e); \ 75 ((q)->forw) = (void *)(e); \ 76 } 77 78 79 #define QUEUE_INSERT_TAIL(q, e) \ 80 { \ 81 ((e)->back) = (void *)((q)->back); \ 82 ((e)->forw) = (void *)(q); \ 83 ((q)->back->forw) = (void *)(e); \ 84 ((q)->back) = (void *)(e); \ 85 } 86 87 #define QUEUE_INSERT_SORT(q, e, k, t) \ 88 { \ 89 (void *)(t) = (void *)((q)->forw); \ 90 while (((t)->k) < ((e)->k)) { \ 91 (void *)(t) = (void *)((t)->forw); \ 92 } \ 93 QUEUE_INSERT_TAIL(t, e); \ 94 } 95 96 #define QUEUE_CLIP(e) \ 97 { \ 98 (e)->forw->back = (e)->back; \ 99 (e)->back->forw = (e)->forw; \ 100 (e)->forw = 0; \ 101 (e)->back = 0; \ 102 } 103 104 /* These should be defined in system header files */ 105 106 extern int atoi(const char *); 107 extern int getchar(void); 108 109 /* 110 * PBSHORTCUT - remove this when we replace BYTE/WORD/DWORD to 111 * uint8_t/uint16_t/uint32_t and <inet/ip.h> gets included by 112 * files that invoke the following functions. 113 */ 114 extern char *inet_ntop(int, const void *, char *, int); 115 extern int inet_pton(int, char *, void *); 116 117 #ifdef __cplusplus 118 } 119 #endif 120 121 #endif /* _SMBSRV_SMB_INCL_H */ 122