windows-vc-locks-and-more-20060115
[openafs.git] / src / WINNT / afsd / lanahelper.h
1 /*
2
3 Copyright 2004 by the Massachusetts Institute of Technology
4
5 All rights reserved.
6
7 Permission to use, copy, modify, and distribute this software and its
8 documentation for any purpose and without fee is hereby granted,
9 provided that the above copyright notice appear in all copies and that
10 both that copyright notice and this permission notice appear in
11 supporting documentation, and that the name of the Massachusetts
12 Institute of Technology (M.I.T.) not be used in advertising or publicity
13 pertaining to distribution of the software without specific, written
14 prior permission.
15
16 M.I.T. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
17 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
18 M.I.T. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
19 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
20 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
21 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
22 SOFTWARE.
23
24 */
25
26 #ifndef __LANAHELPER_H__
27 #define __LANAHELPER_H__
28
29 #include <windows.h>
30 #include <tchar.h>
31
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35
36   typedef BYTE lana_number_t;
37
38 #define LANA_INVALID 0xff
39
40     struct LANAINFO
41     {
42         lana_number_t lana_number;
43         TCHAR lana_name[MAX_PATH];
44     };
45
46 #define LANA_INVALID 0xff
47 #define MAX_NB_NAME_LENGTH 17
48
49 #define LANA_NETBIOS_NAME_SUFFIX 1
50 #define LANA_NETBIOS_NAME_FULL 0
51
52 #define LANA_NETBIOS_NAME_IN 2
53
54     int lana_GetNameFromGuid(char *Guid, char **Name);
55
56     struct LANAINFO * lana_FindLanaByName(const char *LanaName);
57
58     lana_number_t lana_FindLoopback(void);
59
60     BOOL lana_OnlyLoopback(void);
61
62     BOOL lana_IsLoopback(lana_number_t lana);
63
64     long lana_GetUncServerNameEx(char *buffer, lana_number_t * pLana, int * pIsGateway, int flags);
65
66     void lana_GetUncServerNameDynamic(int lanaNumber, BOOL isGateway, TCHAR *name, int type);
67
68     void lana_GetUncServerName(TCHAR *name, int type);
69
70     void lana_GetAfsNameString(int lanaNumber, BOOL isGateway, TCHAR* name);
71
72     void lana_GetNetbiosName(LPTSTR pszName, int type);
73
74 #ifdef __cplusplus
75 }
76 #endif
77
78 #endif
79