summaryrefslogtreecommitdiffstats
path: root/contrib/smbfs/include
diff options
context:
space:
mode:
authorsheldonh <sheldonh@FreeBSD.org>2001-12-14 11:06:03 +0000
committersheldonh <sheldonh@FreeBSD.org>2001-12-14 11:06:03 +0000
commit4e260b134ff188548ec2c8a16a37570a4abf1257 (patch)
tree672d7786f89ed3b67f221098cb86cf0bc53ad5e3 /contrib/smbfs/include
downloadFreeBSD-src-4e260b134ff188548ec2c8a16a37570a4abf1257.zip
FreeBSD-src-4e260b134ff188548ec2c8a16a37570a4abf1257.tar.gz
Import smbfs-1.4.1.
This is Boris Popov's SMB/CIFS file system implementation for FreeBSD. Obtained from: Boris Popov via ftp://ftp.butya.kz/pub/smbfs/
Diffstat (limited to 'contrib/smbfs/include')
-rw-r--r--contrib/smbfs/include/cflib.h86
-rw-r--r--contrib/smbfs/include/netsmb/nb_lib.h147
-rw-r--r--contrib/smbfs/include/netsmb/smb_lib.h256
-rw-r--r--contrib/smbfs/include/netsmb/smb_rap.h74
4 files changed, 563 insertions, 0 deletions
diff --git a/contrib/smbfs/include/cflib.h b/contrib/smbfs/include/cflib.h
new file mode 100644
index 0000000..61e3c23
--- /dev/null
+++ b/contrib/smbfs/include/cflib.h
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2000, Boris Popov
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Boris Popov.
+ * 4. Neither the name of the author nor the names of any co-contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $Id: cflib.h,v 1.3 2000/07/11 01:51:49 bp Exp $
+ */
+#ifndef _zzzzzz_RCFILE_H_
+#define _zzzzzz_RCFILE_H_
+
+struct rcfile;
+
+/*
+ * A unified options parser
+ */
+enum opt_argtype {OPTARG_STR, OPTARG_INT, OPTARG_BOOL};
+
+struct opt_args;
+
+typedef int opt_callback_t (struct opt_args*);
+
+#define OPTFL_NONE 0x0000
+#define OPTFL_HAVEMIN 0x0001
+#define OPTFL_HAVEMAX 0x0002
+#define OPTFL_MINMAX NAFL_HAVEMIN | NAFL_HAVEMAX
+
+struct opt_args {
+ enum opt_argtype type;
+ int opt; /* command line option */
+ char * name; /* rc file equiv */
+ int flag; /* OPTFL_* */
+ int ival; /* int/bool values, or max len for str value */
+ char * str; /* string value */
+ int min; /* min for ival */
+ int max; /* max for ival */
+ opt_callback_t *fn; /* call back to validate */
+};
+
+extern int cf_opterr, cf_optind, cf_optopt, cf_optreset;
+extern const char *cf_optarg;
+
+__BEGIN_DECLS
+
+int opt_args_parse(struct rcfile *, struct opt_args *, const char *,
+ opt_callback_t *);
+int opt_args_parseopt(struct opt_args *, int, char *, opt_callback_t *);
+
+int cf_getopt(int, char * const *, const char *);
+
+int rc_open(const char *, const char *, struct rcfile **);
+int rc_close(struct rcfile *);
+int rc_merge(const char *, struct rcfile **);
+int rc_getstringptr(struct rcfile *, const char *, const char *, char **);
+int rc_getstring(struct rcfile *, const char *, const char *, size_t, char *);
+int rc_getint(struct rcfile *, const char *, const char *, int *);
+int rc_getbool(struct rcfile *, const char *, const char *, int *);
+
+__END_DECLS
+
+#endif /* _zzzzzz_RCFILE_H_ */
diff --git a/contrib/smbfs/include/netsmb/nb_lib.h b/contrib/smbfs/include/netsmb/nb_lib.h
new file mode 100644
index 0000000..dbbdc6b
--- /dev/null
+++ b/contrib/smbfs/include/netsmb/nb_lib.h
@@ -0,0 +1,147 @@
+/*
+ * Copyright (c) 2000, Boris Popov
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Boris Popov.
+ * 4. Neither the name of the author nor the names of any co-contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $Id: nb_lib.h,v 1.2 2000/07/17 01:49:27 bp Exp $
+ */
+#ifndef _NETSMB_NB_LIB_H_
+#define _NETSMB_NB_LIB_H_
+
+/*
+ * Error codes
+ */
+#define NBERR_INVALIDFORMAT 0x0001
+#define NBERR_SRVFAILURE 0x0002
+#define NBERR_NAMENOTFOUND 0x0003
+#define NBERR_IMP 0x0004
+#define NBERR_REFUSED 0x0005
+#define NBERR_ACTIVE 0x0006
+#define NBERR_HOSTNOTFOUND 0x0101
+#define NBERR_TOOMANYREDIRECTS 0x0102
+#define NBERR_INVALIDRESPONSE 0x0103
+#define NBERR_NAMETOOLONG 0x0104
+#define NBERR_NOBCASTIFS 0x0105
+#define NBERR_MAX 0x0106
+#define NBERROR(e) ((e) | SMB_NB_ERROR)
+
+#define NBCF_RESOLVED 0x0001
+
+/*
+ * nb environment
+ */
+struct nb_ctx {
+ int nb_flags;
+ int nb_timo;
+ char * nb_scope; /* NetBIOS scope */
+ char * nb_nsname; /* name server */
+ struct sockaddr_in nb_ns; /* ip addr of name server */
+ struct sockaddr_in nb_lastns;
+};
+
+/*
+ * resource record
+ */
+struct nbns_rr {
+ u_char * rr_name; /* compressed NETBIOS name */
+ u_int16_t rr_type;
+ u_int16_t rr_class;
+ u_int32_t rr_ttl;
+ u_int16_t rr_rdlength;
+ u_char * rr_data;
+};
+
+#define NBRQF_BROADCAST 0x0001
+/*
+ * nbns request
+ */
+struct nbns_rq {
+ int nr_opcode;
+ int nr_nmflags;
+ int nr_rcode;
+ int nr_qdcount;
+ int nr_ancount;
+ int nr_nscount;
+ int nr_arcount;
+ struct nb_name* nr_qdname;
+ u_int16_t nr_qdtype;
+ u_int16_t nr_qdclass;
+ struct sockaddr_in nr_dest; /* receiver of query */
+ struct sockaddr_in nr_sender; /* sender of response */
+ int nr_rpnmflags;
+ int nr_rprcode;
+ u_int16_t nr_rpancount;
+ u_int16_t nr_rpnscount;
+ u_int16_t nr_rparcount;
+ u_int16_t nr_trnid;
+ struct nb_ctx * nr_nbd;
+ struct mbdata nr_rq;
+ struct mbdata nr_rp;
+ struct nb_ifdesc *nr_if;
+ int nr_flags;
+ int nr_fd;
+};
+
+struct nb_ifdesc {
+ int id_flags;
+ struct in_addr id_addr;
+ struct in_addr id_mask;
+ char id_name[16]; /* actually IFNAMSIZ */
+ struct nb_ifdesc * id_next;
+};
+
+struct sockaddr;
+
+__BEGIN_DECLS
+
+int nb_name_len(struct nb_name *);
+int nb_name_encode(struct nb_name *, u_char *);
+int nb_encname_len(const char *);
+
+int nb_snballoc(int namelen, struct sockaddr_nb **);
+void nb_snbfree(struct sockaddr*);
+int nb_sockaddr(struct sockaddr *, struct nb_name *, struct sockaddr_nb **);
+
+int nb_resolvehost_in(const char *, struct sockaddr **);
+int nbns_resolvename(const char *, struct nb_ctx *, struct sockaddr **);
+int nb_getlocalname(char *name);
+int nb_enum_if(struct nb_ifdesc **, int);
+
+const char *nb_strerror(int error);
+
+int nb_ctx_create(struct nb_ctx **);
+void nb_ctx_done(struct nb_ctx *);
+int nb_ctx_setns(struct nb_ctx *, const char *);
+int nb_ctx_setscope(struct nb_ctx *, const char *);
+int nb_ctx_resolve(struct nb_ctx *);
+int nb_ctx_readrcsection(struct rcfile *, struct nb_ctx *, const char *, int);
+
+__END_DECLS
+
+#endif /* !_NETSMB_NB_LIB_H_ */
diff --git a/contrib/smbfs/include/netsmb/smb_lib.h b/contrib/smbfs/include/netsmb/smb_lib.h
new file mode 100644
index 0000000..24fccb8
--- /dev/null
+++ b/contrib/smbfs/include/netsmb/smb_lib.h
@@ -0,0 +1,256 @@
+/*
+ * Copyright (c) 2000-2001 Boris Popov
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Boris Popov.
+ * 4. Neither the name of the author nor the names of any co-contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $Id: smb_lib.h,v 1.22 2001/04/10 05:37:22 bp Exp $
+ */
+#ifndef _NETSMB_SMB_LIB_H_
+#define _NETSMB_SMB_LIB_H_
+
+#include <netsmb/smb.h>
+#include <netsmb/smb_dev.h>
+
+#define SMB_CFG_FILE "/usr/local/etc/nsmb.conf"
+
+#define STDPARAM_ARGS 'A':case 'B':case 'C':case 'E':case 'I': \
+ case 'L':case 'M': \
+ case 'N':case 'U':case 'R':case 'S':case 'T': \
+ case 'W':case 'O':case 'P'
+
+#define STDPARAM_OPT "A:BCE:I:L:M:NO:P:U:R:S:T:W:"
+
+/*
+ * bits to indicate the source of error
+ */
+#define SMB_ERRTYPE_MASK 0xf0000
+#define SMB_SYS_ERROR 0x00000
+#define SMB_RAP_ERROR 0x10000
+#define SMB_NB_ERROR 0x20000
+
+#ifndef min
+#define min(a,b) (((a)<(b)) ? (a) : (b))
+#endif
+
+#define getb(buf,ofs) (((const u_int8_t *)(buf))[ofs])
+#define setb(buf,ofs,val) (((u_int8_t*)(buf))[ofs])=val
+#define getbw(buf,ofs) ((u_int16_t)(getb(buf,ofs)))
+#define getw(buf,ofs) (*((u_int16_t*)(&((u_int8_t*)(buf))[ofs])))
+#define getdw(buf,ofs) (*((u_int32_t*)(&((u_int8_t*)(buf))[ofs])))
+
+#if (BYTE_ORDER == LITTLE_ENDIAN)
+
+#define getwle(buf,ofs) (*((u_int16_t*)(&((u_int8_t*)(buf))[ofs])))
+#define getdle(buf,ofs) (*((u_int32_t*)(&((u_int8_t*)(buf))[ofs])))
+#define getwbe(buf,ofs) (ntohs(getwle(buf,ofs)))
+#define getdbe(buf,ofs) (ntohl(getdle(buf,ofs)))
+
+#define setwle(buf,ofs,val) getwle(buf,ofs)=val
+#define setwbe(buf,ofs,val) getwle(buf,ofs)=htons(val)
+#define setdle(buf,ofs,val) getdle(buf,ofs)=val
+#define setdbe(buf,ofs,val) getdle(buf,ofs)=htonl(val)
+
+#else /* (BYTE_ORDER == LITTLE_ENDIAN) */
+#error "Macros for Big-Endians are incomplete"
+#define getwle(buf,ofs) ((u_int16_t)(getb(buf, ofs) | (getb(buf, ofs + 1) << 8)))
+#define getdle(buf,ofs) ((u_int32_t)(getb(buf, ofs) | \
+ (getb(buf, ofs + 1) << 8) | \
+ (getb(buf, ofs + 2) << 16) | \
+ (getb(buf, ofs + 3) << 24)))
+#define getwbe(buf,ofs) (*((u_int16_t*)(&((u_int8_t*)(buf))[ofs])))
+#define getdbe(buf,ofs) (*((u_int32_t*)(&((u_int8_t*)(buf))[ofs])))
+/*
+#define setwle(buf,ofs,val) getwle(buf,ofs)=val
+#define setdle(buf,ofs,val) getdle(buf,ofs)=val
+*/
+#define setwbe(buf,ofs,val) getwle(buf,ofs)=val
+#define setdbe(buf,ofs,val) getdle(buf,ofs)=val
+
+#endif /* (BYTE_ORDER == LITTLE_ENDIAN) */
+
+/*
+ * SMB work context. Used to store all values which is necessary
+ * to establish connection to an SMB server.
+ */
+struct smb_ctx {
+ int ct_flags; /* SMBCF_ */
+ int ct_fd; /* handle of connection */
+ int ct_parsedlevel;
+ int ct_minlevel;
+ int ct_maxlevel;
+ char * ct_srvaddr; /* hostname or IP address of server */
+ char ct_locname[SMB_MAXUSERNAMELEN + 1];
+ const char * ct_uncnext;
+ struct nb_ctx * ct_nb;
+ struct smbioc_ossn ct_ssn;
+ struct smbioc_oshare ct_sh;
+};
+
+#define SMBCF_NOPWD 0x0001 /* don't ask for a password */
+#define SMBCF_SRIGHTS 0x0002 /* share access rights was supplied */
+#define SMBCF_LOCALE 0x0004 /* use current locale */
+#define SMBCF_RESOLVED 0x8000 /* structure has been verified */
+
+/*
+ * request handling structures
+ */
+struct mbuf {
+ int m_len;
+ int m_maxlen;
+ char * m_data;
+ struct mbuf * m_next;
+};
+
+struct mbdata {
+ struct mbuf * mb_top;
+ struct mbuf * mb_cur;
+ char * mb_pos;
+ int mb_count;
+};
+
+#define M_ALIGNFACTOR (sizeof(long))
+#define M_ALIGN(len) (((len) + M_ALIGNFACTOR - 1) & ~(M_ALIGNFACTOR - 1))
+#define M_BASESIZE (sizeof(struct mbuf))
+#define M_MINSIZE (256 - M_BASESIZE)
+#define M_TOP(m) ((char*)(m) + M_BASESIZE)
+#define mtod(m,t) ((t)(m)->m_data)
+#define M_TRAILINGSPACE(m) ((m)->m_maxlen - (m)->m_len)
+
+struct smb_rq {
+ u_char rq_cmd;
+ struct mbdata rq_rq;
+ struct mbdata rq_rp;
+ struct smb_ctx *rq_ctx;
+ int rq_wcount;
+ int rq_bcount;
+};
+
+struct smb_bitname {
+ u_int bn_bit;
+ char *bn_name;
+};
+
+extern struct rcfile *smb_rc;
+
+__BEGIN_DECLS
+
+struct sockaddr;
+
+int smb_lib_init(void);
+int smb_open_rcfile(void);
+void smb_error(const char *, int,...);
+char *smb_printb(char *, int, const struct smb_bitname *);
+void *smb_dumptree(void);
+
+/*
+ * Context management
+ */
+int smb_ctx_init(struct smb_ctx *, int, char *[], int, int, int);
+void smb_ctx_done(struct smb_ctx *);
+int smb_ctx_parseunc(struct smb_ctx *, const char *, int, const char **);
+int smb_ctx_setcharset(struct smb_ctx *, const char *);
+int smb_ctx_setserver(struct smb_ctx *, const char *);
+int smb_ctx_setuser(struct smb_ctx *, const char *);
+int smb_ctx_setshare(struct smb_ctx *, const char *, int);
+int smb_ctx_setscope(struct smb_ctx *, const char *);
+int smb_ctx_setworkgroup(struct smb_ctx *, const char *);
+int smb_ctx_setpassword(struct smb_ctx *, const char *);
+int smb_ctx_setsrvaddr(struct smb_ctx *, const char *);
+int smb_ctx_opt(struct smb_ctx *, int, const char *);
+int smb_ctx_lookup(struct smb_ctx *, int, int);
+int smb_ctx_login(struct smb_ctx *);
+int smb_ctx_readrc(struct smb_ctx *);
+int smb_ctx_resolve(struct smb_ctx *);
+int smb_ctx_setflags(struct smb_ctx *, int, int, int);
+
+int smb_smb_open_print_file(struct smb_ctx *, int, int, const char *, smbfh*);
+int smb_smb_close_print_file(struct smb_ctx *, smbfh);
+
+int smb_read(struct smb_ctx *, smbfh, off_t, size_t, char *);
+int smb_write(struct smb_ctx *, smbfh, off_t, size_t, const char *);
+
+#define smb_rq_getrequest(rqp) (&(rqp)->rq_rq)
+#define smb_rq_getreply(rqp) (&(rqp)->rq_rp)
+
+int smb_rq_init(struct smb_ctx *, u_char, size_t, struct smb_rq **);
+void smb_rq_done(struct smb_rq *);
+void smb_rq_wend(struct smb_rq *);
+int smb_rq_simple(struct smb_rq *);
+int smb_rq_dmem(struct mbdata *, const char *, size_t);
+int smb_rq_dstring(struct mbdata *, const char *);
+
+int smb_t2_request(struct smb_ctx *, int, int, const char *,
+ int, void *, int, void *, int *, void *, int *, void *);
+
+void smb_simplecrypt(char *dst, const char *src);
+int smb_simpledecrypt(char *dst, const char *src);
+
+int m_getm(struct mbuf *, size_t, struct mbuf **);
+int m_lineup(struct mbuf *, struct mbuf **);
+int mb_init(struct mbdata *, size_t);
+int mb_initm(struct mbdata *, struct mbuf *);
+int mb_done(struct mbdata *);
+int mb_fit(struct mbdata *mbp, size_t size, char **pp);
+int mb_put_uint8(struct mbdata *, u_int8_t);
+int mb_put_uint16be(struct mbdata *, u_int16_t);
+int mb_put_uint16le(struct mbdata *, u_int16_t);
+int mb_put_uint32be(struct mbdata *, u_int32_t);
+int mb_put_uint32le(struct mbdata *, u_int32_t);
+int mb_put_int64be(struct mbdata *, int64_t);
+int mb_put_int64le(struct mbdata *, int64_t);
+int mb_put_mem(struct mbdata *, const char *, size_t);
+int mb_put_pstring(struct mbdata *mbp, const char *s);
+int mb_put_mbuf(struct mbdata *, struct mbuf *);
+
+int mb_get_uint8(struct mbdata *, u_int8_t *);
+int mb_get_uint16(struct mbdata *, u_int16_t *);
+int mb_get_uint16le(struct mbdata *, u_int16_t *);
+int mb_get_uint16be(struct mbdata *, u_int16_t *);
+int mb_get_uint32(struct mbdata *, u_int32_t *);
+int mb_get_uint32be(struct mbdata *, u_int32_t *);
+int mb_get_uint32le(struct mbdata *, u_int32_t *);
+int mb_get_int64(struct mbdata *, int64_t *);
+int mb_get_int64be(struct mbdata *, int64_t *);
+int mb_get_int64le(struct mbdata *, int64_t *);
+int mb_get_mem(struct mbdata *, char *, size_t);
+
+extern u_char nls_lower[256], nls_upper[256];
+
+int nls_setrecode(const char *, const char *);
+int nls_setlocale(const char *);
+char* nls_str_toext(char *, const char *);
+char* nls_str_toloc(char *, const char *);
+void* nls_mem_toext(void *, const void *, int);
+void* nls_mem_toloc(void *, const void *, int);
+char* nls_str_upper(char *, const char *);
+char* nls_str_lower(char *, const char *);
+
+__END_DECLS
+
+#endif /* _NETSMB_SMB_LIB_H_ */
diff --git a/contrib/smbfs/include/netsmb/smb_rap.h b/contrib/smbfs/include/netsmb/smb_rap.h
new file mode 100644
index 0000000..cb867a5
--- /dev/null
+++ b/contrib/smbfs/include/netsmb/smb_rap.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2000-2001, Boris Popov
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Boris Popov.
+ * 4. Neither the name of the author nor the names of any co-contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $Id: smb_rap.h,v 1.3 2001/04/10 05:37:22 bp Exp $
+ */
+#ifndef _NETSMB_SMB_RAP_H_
+#define _NETSMB_SMB_RAP_H_
+
+struct smb_rap {
+ char * r_sparam;
+ char * r_nparam;
+ char * r_sdata;
+ char * r_ndata;
+ char * r_pbuf; /* rq parameters */
+ int r_plen; /* rq param len */
+ char * r_npbuf;
+ char * r_dbuf; /* rq data */
+ int r_dlen; /* rq data len */
+ char * r_ndbuf;
+ u_int32_t r_result;
+ char * r_rcvbuf;
+ int r_rcvbuflen;
+ int r_entries;
+};
+
+struct smb_share_info_1 {
+ char shi1_netname[13];
+ char shi1_pad;
+ u_int16_t shi1_type;
+ u_int32_t shi1_remark; /* char * */
+};
+
+__BEGIN_DECLS
+
+int smb_rap_create(int, const char *, const char *, struct smb_rap **);
+void smb_rap_done(struct smb_rap *);
+int smb_rap_request(struct smb_rap *, struct smb_ctx *);
+int smb_rap_setNparam(struct smb_rap *, long);
+int smb_rap_setPparam(struct smb_rap *, void *);
+int smb_rap_error(struct smb_rap *, int);
+
+int smb_rap_NetShareEnum(struct smb_ctx *, int, void *, int, int *, int *);
+
+__END_DECLS
+
+#endif /* _NETSMB_SMB_RAP_H_ */
OpenPOWER on IntegriCloud