mirror of
https://github.com/TalAloni/SMBLibrary.git
synced 2025-08-13 02:39:18 +02:00
NetBios: NameFlags: Added explicit conversion from ushort
This commit is contained in:
parent
96120008c5
commit
3c67594c73
1 changed files with 9 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (C) 2014-2017 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
|
/* Copyright (C) 2014-2020 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
|
||||||
*
|
*
|
||||||
* You can redistribute this program and/or modify it under the terms of
|
* You can redistribute this program and/or modify it under the terms of
|
||||||
* the GNU Lesser Public License as published by the Free Software Foundation,
|
* the GNU Lesser Public License as published by the Free Software Foundation,
|
||||||
|
@ -34,5 +34,13 @@ namespace SMBLibrary.NetBios
|
||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static explicit operator NameFlags(ushort value)
|
||||||
|
{
|
||||||
|
NameFlags result = new NameFlags();
|
||||||
|
result.NodeType = (OwnerNodeType)((value >> 13) & 0x3);
|
||||||
|
result.WorkGroup = (value & 0x8000) > 0;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue