summaryrefslogtreecommitdiffstats
path: root/private/ntos/dlc/dlcreg.h
blob: be94d86051357546c817fd3e2c5f22fd8b2884f0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
/*++

Copyright (c) 1991  Microsoft Corporation

Module Name:

    dlcreg.h

Abstract:

    Defines, Structures, Typedefs, Macros, Externs and Prototypes for dlcreg.c

Author:

    Richard L Firth (rfirth) 31-Mar-1993

Revision History:

    30-Mar-1993 rfirth
        created

    04-May-1994 rfirth
        Exposed GetAdapterParameters

--*/

#ifndef _DLCREG_
#define _DLCREG_

//
// manifests
//

#define PARAMETER_AS_SPECIFIED      ((ULONG)-1)
#define PARAMETER_IS_BOOLEAN        1
#define PARAMETER_IS_UCHAR          2

//
// types
//

//
// REGISTRY_PARAMETER_DESCRIPTOR - structure used to get values from registry
// entries. Maintains information about a registry entry and supplies a default
// value should the registry entry not be available
//

typedef struct {
    ULONG   Type;       // expected type
    ULONG   RealType;   // eg. PARAMETER_BOOLEAN
    PVOID   Value;      // default value if REG_DWORD, or pointer to default value
    ULONG   Length;     // IN: expected length of variable; OUT: actual length
    PVOID   Variable;   // pointer to variable to update from registry
    ULONG   LowerLimit; // lower limit for REG_DWORD values
    ULONG   UpperLimit; // upper limit for REG_DWORD values
} REGISTRY_PARAMETER_DESCRIPTOR, *PREGISTRY_PARAMETER_DESCRIPTOR;

//
// DLC_REGISTRY_PARAMETER - describes an entry in the DLC\Parameters\<adapter>
// section. Supplies the name of the parameter and its default value
//

typedef struct {
    PWSTR ParameterName;
    PVOID DefaultValue;
    REGISTRY_PARAMETER_DESCRIPTOR Descriptor;
} DLC_REGISTRY_PARAMETER, *PDLC_REGISTRY_PARAMETER;

//
// ADAPTER_CONFIGURATION_INFO - for each adapter that DLC can talk to, there is
// potentially the following configuration information which can be stored in
// the DLC\Parameters\<adapter_name> key. The values are not necessarily stored
// in the format in which they are used internally
//

typedef struct {

    //
    // SwapAddressBits - when talking over Ethernet, defines whether to swap the
    // outgoing destination address bits and incoming source address bits
    //

    BOOLEAN SwapAddressBits;

    //
    // UseDix - if the Ethernet type in the DIR.OPEN.ADAPTER is set to default,
    // then we consult this flag to determine whether to send DIX or 802.3
    // format Ethernet frames. The default is 802.3 (ie UseDix = 0)
    //

    BOOLEAN UseDix;

    //
    // T1TickOne, T2TickOne, TiTickOne, T1TickTwo, T2TickTwo, TiTickTwo - timer
    // tick values in 40mSec increments. Contained in LLC_TICKS structure
    //

    LLC_TICKS TimerTicks;

    //
    // UseEthernetFrameSize - if set for a non-TR card then we use the value
    // reported by ethernet cards for the maximum frame size, else we query
    // the MAC for the maximum supported frame size.
    // Bridging is the mother of this invention: we need some way to influence
    // DLC's maximum frame size when talking over non-Token Ring nets - FDDI
    // and Ethernet in this case.
    //

    BOOLEAN UseEthernetFrameSize;

} ADAPTER_CONFIGURATION_INFO, *PADAPTER_CONFIGURATION_INFO;

//
// prototypes
//

VOID
DlcRegistryInitialization(
    IN PUNICODE_STRING RegistryPath
    );

VOID
DlcRegistryTermination(
    VOID
    );

VOID
LoadDlcConfiguration(
    VOID
    );

VOID
LoadAdapterConfiguration(
    IN PUNICODE_STRING AdapterName,
    OUT PADAPTER_CONFIGURATION_INFO ConfigInfo
    );

NTSTATUS
GetAdapterParameters(
    IN PUNICODE_STRING AdapterName,
    IN PDLC_REGISTRY_PARAMETER Parameters,
    IN ULONG NumberOfParameters,
    IN BOOLEAN SetOnFail
    );

#endif // _DLCREG_