source: vendor/3.6.0/source3/libsmb/nmblib.h

Last change on this file was 740, checked in by Silvan Scherrer, 13 years ago

Samba Server: update vendor to 3.6.0

File size: 3.1 KB
Line 
1/*
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
7
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.
12
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.
17
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/>.
20
21*/
22
23#ifndef _LIBSMB_NMBLIB_H_
24#define _LIBSMB_NMBLIB_H_
25
26/* The following definitions come from libsmb/unexpected.c */
27
28#include "nameserv.h"
29
30struct nb_packet_server;
31struct nb_packet_reader;
32
33NTSTATUS nb_packet_server_create(TALLOC_CTX *mem_ctx,
34 struct tevent_context *ev,
35 int max_clients,
36 struct nb_packet_server **presult);
37void nb_packet_dispatch(struct nb_packet_server *server,
38 struct packet_struct *p);
39struct tevent_req *nb_packet_reader_send(TALLOC_CTX *mem_ctx,
40 struct tevent_context *ev,
41 enum packet_type type,
42 int trn_id,
43 const char *mailslot_name);
44NTSTATUS nb_packet_reader_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
45 struct nb_packet_reader **preader);
46struct tevent_req *nb_packet_read_send(TALLOC_CTX *mem_ctx,
47 struct tevent_context *ev,
48 struct nb_packet_reader *reader);
49NTSTATUS nb_packet_read_recv(struct tevent_req *req,
50 struct packet_struct **ppacket);
51
52/* The following definitions come from libsmb/nmblib.c */
53
54void debug_nmb_packet(struct packet_struct *p);
55void put_name(char *dest, const char *name, int pad, unsigned int name_type);
56char *nmb_namestr(const struct nmb_name *n);
57struct packet_struct *copy_packet(struct packet_struct *packet);
58void free_packet(struct packet_struct *packet);
59int packet_trn_id(struct packet_struct *p);
60struct packet_struct *parse_packet(char *buf,int length,
61 enum packet_type packet_type,
62 struct in_addr ip,
63 int port);
64struct packet_struct *read_packet(int fd,enum packet_type packet_type);
65void make_nmb_name( struct nmb_name *n, const char *name, int type);
66bool nmb_name_equal(struct nmb_name *n1, struct nmb_name *n2);
67int build_packet(char *buf, size_t buflen, struct packet_struct *p);
68bool send_packet(struct packet_struct *p);
69bool match_mailslot_name(struct packet_struct *p, const char *mailslot_name);
70int matching_len_bits(unsigned char *p1, unsigned char *p2, size_t len);
71void sort_query_replies(char *data, int n, struct in_addr ip);
72char *name_mangle(TALLOC_CTX *mem_ctx, const char *In, char name_type);
73int name_extract(unsigned char *buf,size_t buf_len, unsigned int ofs, fstring name);
74int name_len(unsigned char *s1, size_t buf_len);
75
76#endif /* _LIBSMB_NMBLIB_H_ */
Note: See TracBrowser for help on using the repository browser.