2 Unix SMB/CIFS implementation.
3 handle unexpected packets
4 NBT netbios library routines
5 Copyright (C) Andrew Tridgell 1994-1998, 2000
6 Copyright (C) Jeremy Allison 2007
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
23 #ifndef _LIBSMB_NMBLIB_H_
24 #define _LIBSMB_NMBLIB_H_
26 /* The following definitions come from libsmb/unexpected.c */
30 /* The following definitions come from libsmb/nmblib.c */
32 const char *global_nmbd_socket_dir(void);
34 void debug_nmb_packet(struct packet_struct
*p
);
35 void put_name(char *dest
, const char *name
, int pad
, unsigned int name_type
);
36 char *nmb_namestr(const struct nmb_name
*n
);
37 struct packet_struct
*copy_packet(struct packet_struct
*packet
);
38 void free_packet(struct packet_struct
*packet
);
39 int packet_trn_id(struct packet_struct
*p
);
40 struct packet_struct
*parse_packet(char *buf
,int length
,
41 enum packet_type packet_type
,
44 struct packet_struct
*parse_packet_talloc(TALLOC_CTX
*mem_ctx
,
46 enum packet_type packet_type
,
49 void make_nmb_name( struct nmb_name
*n
, const char *name
, int type
);
50 bool nmb_name_equal(struct nmb_name
*n1
, struct nmb_name
*n2
);
51 int build_packet(char *buf
, size_t buflen
, struct packet_struct
*p
);
52 bool send_packet(struct packet_struct
*p
);
53 bool match_mailslot_name(struct packet_struct
*p
, const char *mailslot_name
);
54 int matching_len_bits(const unsigned char *p1
, const unsigned char *p2
, size_t len
);
55 void sort_query_replies(char *data
, int n
, struct in_addr ip
);
56 char *name_mangle(TALLOC_CTX
*mem_ctx
, const char *In
, char name_type
);
57 int name_extract(unsigned char *buf
,size_t buf_len
, unsigned int ofs
, fstring name
);
58 int name_len(unsigned char *s1
, size_t buf_len
);
59 int cli_set_message(char *buf
,int num_words
,int num_bytes
,bool zero
);
61 #endif /* _LIBSMB_NMBLIB_H_ */