Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Viewer
Alchemy Viewer
Commits
2cb9ffc4
Commit
2cb9ffc4
authored
4 years ago
by
Rye Mutt
Browse files
Options
Downloads
Patches
Plain Diff
Make NetBios go away.
parent
94a31ec3
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
indra/cmake/Linking.cmake
+0
-1
0 additions, 1 deletion
indra/cmake/Linking.cmake
indra/cmake/PluginAPI.cmake
+0
-1
0 additions, 1 deletion
indra/cmake/PluginAPI.cmake
indra/llcommon/lluuid.cpp
+75
-36
75 additions, 36 deletions
indra/llcommon/lluuid.cpp
with
75 additions
and
38 deletions
indra/cmake/Linking.cmake
+
0
−
1
View file @
2cb9ffc4
...
@@ -65,7 +65,6 @@ if (WINDOWS)
...
@@ -65,7 +65,6 @@ if (WINDOWS)
mswsock
mswsock
psapi
psapi
winmm
winmm
netapi32
wldap32
wldap32
gdi32
gdi32
user32
user32
...
...
This diff is collapsed.
Click to expand it.
indra/cmake/PluginAPI.cmake
+
0
−
1
View file @
2cb9ffc4
...
@@ -5,7 +5,6 @@ if (WINDOWS)
...
@@ -5,7 +5,6 @@ if (WINDOWS)
wsock32
wsock32
ws2_32
ws2_32
psapi
psapi
netapi32
advapi32
advapi32
user32
user32
)
)
...
...
This diff is collapsed.
Click to expand it.
indra/llcommon/lluuid.cpp
+
75
−
36
View file @
2cb9ffc4
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
// We can't use WIN32_LEAN_AND_MEAN here, needs lots of includes.
// We can't use WIN32_LEAN_AND_MEAN here, needs lots of includes.
#if LL_WINDOWS
#if LL_WINDOWS
#include
"llwin32headers.h"
#include
"llwin32headers
lean
.h"
// ugh, this is ugly. We need to straighten out our linking for this library
// ugh, this is ugly. We need to straighten out our linking for this library
#pragma comment(lib, "IPHLPAPI.lib")
#pragma comment(lib, "IPHLPAPI.lib")
#include
<iphlpapi.h>
#include
<iphlpapi.h>
...
@@ -456,51 +456,88 @@ static void get_random_bytes(void *buf, int nbytes)
...
@@ -456,51 +456,88 @@ static void get_random_bytes(void *buf, int nbytes)
#if LL_WINDOWS
#if LL_WINDOWS
typedef
struct
_ASTAT_
{
ADAPTER_STATUS
adapt
;
NAME_BUFFER
NameBuff
[
30
];
}
ASTAT
,
*
PASTAT
;
// static
// static
S32
LLUUID
::
getNodeID
(
unsigned
char
*
node_id
)
S32
LLUUID
::
getNodeID
(
unsigned
char
*
node_id
)
{
{
ASTAT
Adapter
;
static
bool
got_node_id
=
false
;
NCB
Ncb
;
static
unsigned
char
local_node_id
[
6
];
UCHAR
uRetCode
;
if
(
got_node_id
)
LANA_ENUM
lenum
;
{
int
i
;
memcpy
(
node_id
,
local_node_id
,
sizeof
(
local_node_id
));
int
retval
=
0
;
return
1
;
}
memset
(
&
Ncb
,
0
,
sizeof
(
Ncb
)
);
S32
retval
=
0
;
Ncb
.
ncb_command
=
NCBENUM
;
PIP_ADAPTER_ADDRESSES
pAddresses
=
nullptr
;
Ncb
.
ncb_buffer
=
(
UCHAR
*
)
&
lenum
;
ULONG
outBufLen
=
0U
;
Ncb
.
ncb_length
=
sizeof
(
lenum
);
DWORD
dwRetVal
=
0U
;
uRetCode
=
Netbios
(
&
Ncb
);
for
(
i
=
0
;
i
<
lenum
.
length
;
i
++
)
ULONG
family
=
AF_INET
;
{
ULONG
flags
=
GAA_FLAG_INCLUDE_PREFIX
|
GAA_FLAG_INCLUDE_GATEWAYS
;
memset
(
&
Ncb
,
0
,
sizeof
(
Ncb
)
);
Ncb
.
ncb_command
=
NCBRESET
;
Ncb
.
ncb_lana_num
=
lenum
.
lana
[
i
];
uRetCode
=
Netbios
(
&
Ncb
);
GetAdaptersAddresses
(
AF_INET
,
flags
,
nullptr
,
nullptr
,
&
outBufLen
);
memset
(
&
Ncb
,
0
,
sizeof
(
Ncb
)
)
;
constexpr
U32
MAX_TRIES
=
3U
;
Ncb
.
ncb_command
=
NCBASTAT
;
U32
iteration
=
0U
;
Ncb
.
ncb_lana_num
=
lenum
.
lana
[
i
];
do
{
strcpy
(
(
char
*
)
Ncb
.
ncb_callname
,
"* "
);
/* Flawfinder: ignore */
pAddresses
=
reinterpret_cast
<
PIP_ADAPTER_ADDRESSES
>
(
malloc
(
outBufLen
));
Ncb
.
ncb_buffer
=
(
unsigned
char
*
)
&
Adapter
;
if
(
pAddresses
==
nullptr
)
{
Ncb
.
ncb_length
=
sizeof
(
Adapter
);
return
0
;
}
uRetCode
=
Netbios
(
&
Ncb
);
dwRetVal
=
if
(
uRetCode
==
0
)
GetAdaptersAddresses
(
family
,
flags
,
nullptr
,
pAddresses
,
&
outBufLen
);
{
memcpy
(
node_id
,
Adapter
.
adapt
.
adapter_address
,
6
);
/* Flawfinder: ignore */
if
(
dwRetVal
==
ERROR_BUFFER_OVERFLOW
)
{
retval
=
1
;
free
(
pAddresses
);
pAddresses
=
nullptr
;
}
}
else
{
break
;
}
++
iteration
;
}
while
((
dwRetVal
==
ERROR_BUFFER_OVERFLOW
)
&&
(
iteration
<
MAX_TRIES
));
if
(
dwRetVal
==
NO_ERROR
)
{
PIP_ADAPTER_ADDRESSES
pCurrAddresses
=
pAddresses
;
PIP_ADAPTER_GATEWAY_ADDRESS
pFirstGateway
=
nullptr
;
do
{
pFirstGateway
=
pCurrAddresses
->
FirstGatewayAddress
;
if
(
pFirstGateway
)
{
if
((
pCurrAddresses
->
IfType
==
IF_TYPE_ETHERNET_CSMACD
||
pCurrAddresses
->
IfType
==
IF_TYPE_IEEE80211
)
&&
pCurrAddresses
->
ConnectionType
==
NET_IF_CONNECTION_DEDICATED
&&
pCurrAddresses
->
OperStatus
==
IfOperStatusUp
)
{
if
(
pCurrAddresses
->
PhysicalAddressLength
==
6
)
{
for
(
size_t
i
=
0
;
i
<
5
;
++
i
)
{
node_id
[
i
]
=
pCurrAddresses
->
PhysicalAddress
[
i
];
local_node_id
[
i
]
=
pCurrAddresses
->
PhysicalAddress
[
i
];
}
retval
=
1
;
got_node_id
=
true
;
break
;
}
}
}
pCurrAddresses
=
pCurrAddresses
->
Next
;
}
while
(
pCurrAddresses
);
// Terminate if last adapter
}
}
if
(
pAddresses
)
free
(
pAddresses
);
pAddresses
=
nullptr
;
return
retval
;
return
retval
;
}
}
...
@@ -892,7 +929,9 @@ U32 LLUUID::getRandomSeed()
...
@@ -892,7 +929,9 @@ U32 LLUUID::getRandomSeed()
md5_seed
.
finalize
();
md5_seed
.
finalize
();
md5_seed
.
raw_digest
(
seed
);
md5_seed
.
raw_digest
(
seed
);
return
(
*
(
U32
*
)
seed
);
U32
out
;
memcpy
(
&
out
,
seed
,
sizeof
(
out
));
return
out
;
}
}
BOOL
LLUUID
::
parseUUID
(
const
std
::
string
&
buf
,
LLUUID
*
value
)
BOOL
LLUUID
::
parseUUID
(
const
std
::
string
&
buf
,
LLUUID
*
value
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment