Netserverenum function return false detail
-
Hi, I am enumerating my network and printing all server name but for mac system it is returning same OS type as windows so i am not able to differentiate machine. i am getting OS type 4099 for mac which is same for windows. also binary conversion is compatible with all predefined macro as i am doing AND with predefined macro.:java
-
Hi, I am enumerating my network and printing all server name but for mac system it is returning same OS type as windows so i am not able to differentiate machine. i am getting OS type 4099 for mac which is same for windows. also binary conversion is compatible with all predefined macro as i am doing AND with predefined macro.:java
-
Does this have something to do with C/C++? If so, please show the relevant part of the code and explain what is incorrect.
it will print false details for mac and linux system. we have pre defined check for unix os type but for mac we dont have any. and the os type we are getting for mac also similar to on eof win 10 os version.
printf("\\tPlatform: %d\\n", pTmpBuf->sv101\_platform\_id); wprintf(L"\\tName: %s\\n", pTmpBuf->sv101\_name); printf("\\tVersion: %d.%d\\n", pTmpBuf->sv101\_version\_major, pTmpBuf->sv101\_version\_minor); printf("\\tType: %d", pTmpBuf->sv101\_type);
Platform: 500
Name: MACMINI-558088
Version: 6.1
Type: 4099Platform: 500 Name: WIN1019H2X64 Version: 10.0 Type: 4099
where macmini is a mac system.
-
it will print false details for mac and linux system. we have pre defined check for unix os type but for mac we dont have any. and the os type we are getting for mac also similar to on eof win 10 os version.
printf("\\tPlatform: %d\\n", pTmpBuf->sv101\_platform\_id); wprintf(L"\\tName: %s\\n", pTmpBuf->sv101\_name); printf("\\tVersion: %d.%d\\n", pTmpBuf->sv101\_version\_major, pTmpBuf->sv101\_version\_minor); printf("\\tType: %d", pTmpBuf->sv101\_type);
Platform: 500
Name: MACMINI-558088
Version: 6.1
Type: 4099Platform: 500 Name: WIN1019H2X64 Version: 10.0 Type: 4099
where macmini is a mac system.
Where and how do you obtain the values you are printing out?
-
Where and how do you obtain the values you are printing out?
does netserverenum function retrives mac system too?
-
Hi, I am enumerating my network and printing all server name but for mac system it is returning same OS type as windows so i am not able to differentiate machine. i am getting OS type 4099 for mac which is same for windows. also binary conversion is compatible with all predefined macro as i am doing AND with predefined macro.:java
Hi, First let me say that I am a Windows guy so I don't know how to troubleshoot the SAMBA or Apple SMB side of your issue. However I believe that you are looking for the SetServiceBits function[^]. This should allow you or your company (or Apple or Google or whoever wants to use this) to define:
#define SV_TYPE_APPLE_MINI_CUSTOM_TYPE 0x123456789
Both the client and server would need to have this type registered. All I can do is tell you what you need to do on the Windows side. Have you tried using SV_TYPE_SERVER_UNIX Looking through the Apple source code[^] I see that they have that one defined. Update: 1.) Looks like SAMBA uses[^] the 'announce as' in the configuration file to set this value. 2.) Apple code shows that they hard code this value with:
default\_server\_announce = 0; default\_server\_announce |= SV\_TYPE\_WORKSTATION; default\_server\_announce |= SV\_TYPE\_SERVER; default\_server\_announce |= SV\_TYPE\_SERVER\_UNIX; default\_server\_announce |= SV\_TYPE\_PRINTQ\_SERVER; switch (lp\_announce\_as()) { case ANNOUNCE\_AS\_NT\_SERVER: { default\_server\_announce |= SV\_TYPE\_SERVER\_NT; /\* fall through... \*/ } case ANNOUNCE\_AS\_NT\_WORKSTATION: { default\_server\_announce |= SV\_TYPE\_NT; break; } case ANNOUNCE\_AS\_WIN95: { default\_server\_announce |= SV\_TYPE\_WIN95\_PLUS; break; } case ANNOUNCE\_AS\_WFW: { default\_server\_announce |= SV\_TYPE\_WFW; break; } default: { break; } }
It's located at the very bottom of loadparm.c[^] So it looks like you will not be able to change this. Maybe you should t
-
it will print false details for mac and linux system. we have pre defined check for unix os type but for mac we dont have any. and the os type we are getting for mac also similar to on eof win 10 os version.
printf("\\tPlatform: %d\\n", pTmpBuf->sv101\_platform\_id); wprintf(L"\\tName: %s\\n", pTmpBuf->sv101\_name); printf("\\tVersion: %d.%d\\n", pTmpBuf->sv101\_version\_major, pTmpBuf->sv101\_version\_minor); printf("\\tType: %d", pTmpBuf->sv101\_type);
Platform: 500
Name: MACMINI-558088
Version: 6.1
Type: 4099Platform: 500 Name: WIN1019H2X64 Version: 10.0 Type: 4099
where macmini is a mac system.
-
Hi, First let me say that I am a Windows guy so I don't know how to troubleshoot the SAMBA or Apple SMB side of your issue. However I believe that you are looking for the SetServiceBits function[^]. This should allow you or your company (or Apple or Google or whoever wants to use this) to define:
#define SV_TYPE_APPLE_MINI_CUSTOM_TYPE 0x123456789
Both the client and server would need to have this type registered. All I can do is tell you what you need to do on the Windows side. Have you tried using SV_TYPE_SERVER_UNIX Looking through the Apple source code[^] I see that they have that one defined. Update: 1.) Looks like SAMBA uses[^] the 'announce as' in the configuration file to set this value. 2.) Apple code shows that they hard code this value with:
default\_server\_announce = 0; default\_server\_announce |= SV\_TYPE\_WORKSTATION; default\_server\_announce |= SV\_TYPE\_SERVER; default\_server\_announce |= SV\_TYPE\_SERVER\_UNIX; default\_server\_announce |= SV\_TYPE\_PRINTQ\_SERVER; switch (lp\_announce\_as()) { case ANNOUNCE\_AS\_NT\_SERVER: { default\_server\_announce |= SV\_TYPE\_SERVER\_NT; /\* fall through... \*/ } case ANNOUNCE\_AS\_NT\_WORKSTATION: { default\_server\_announce |= SV\_TYPE\_NT; break; } case ANNOUNCE\_AS\_WIN95: { default\_server\_announce |= SV\_TYPE\_WIN95\_PLUS; break; } case ANNOUNCE\_AS\_WFW: { default\_server\_announce |= SV\_TYPE\_WFW; break; } default: { break; } }
It's located at the very bottom of loadparm.c[^] So it looks like you will not be able to change this. Maybe you should t
I am using the NetServerEnum function to enumerate the network and printing all records. But I'm getting the same SV type for MAC OS system and Windows10 system. Also, sv101_version_major and sv101_version_minor are wrong. Kindly let me know how this function works, and from where I am getting these values. What is the limitation of this API.
printed logs using the provided example is:
NetServerEnum(pszServerName,
dwLevel,
(LPBYTE *) & pBuf,
dwPrefMaxLen,
&dwEntriesRead,
&dwTotalEntries,
dwServerType,
pszDomainName,
&dwResumeHandle);//Printing logs:
printf("\tPlatform: %d\n", pTmpBuf->sv101_platform_id);
wprintf(L"\tName: %s\n", pTmpBuf->sv101_name);
printf("\tVersion: %d.%d\n",
pTmpBuf->sv101_version_major,
pTmpBuf->sv101_version_minor);
printf("\tType: %d", pTmpBuf->sv101_type);Output=>
Platform: 500
Name: MACMINI-558088
Version: 6.1 //<==VERSION is common among both UNIX and MAC
Type: 4099 //<==SAME SV_TYPE
Platform:500
Name: MAILSRV
Version: 6.1 //<==VERSION is common among both UNIX and MAC
Type: 8493571
Platform:500
Name: WIN1019H2X64
Version: 10.0
Type: 4099 //<==SAME SV_TYPEWhere macmini is MAC and mailsrv is Unix system. sv_type of macmini and WIN1019H2X64 is the same. sv101_version_major and sv101_version_minor are the same for UNIX and MAC systems, which use SAMBA. Kindly let me know why it is? So I can differentiate these systems using predefined macros in lmserver.h.
-
I am using the NetServerEnum function to enumerate the network and printing all records. But I'm getting the same SV type for MAC OS system and Windows10 system. Also, sv101_version_major and sv101_version_minor are wrong. Kindly let me know how this function works, and from where I am getting these values. What is the limitation of this API.
printed logs using the provided example is:
NetServerEnum(pszServerName,
dwLevel,
(LPBYTE *) & pBuf,
dwPrefMaxLen,
&dwEntriesRead,
&dwTotalEntries,
dwServerType,
pszDomainName,
&dwResumeHandle);//Printing logs:
printf("\tPlatform: %d\n", pTmpBuf->sv101_platform_id);
wprintf(L"\tName: %s\n", pTmpBuf->sv101_name);
printf("\tVersion: %d.%d\n",
pTmpBuf->sv101_version_major,
pTmpBuf->sv101_version_minor);
printf("\tType: %d", pTmpBuf->sv101_type);Output=>
Platform: 500
Name: MACMINI-558088
Version: 6.1 //<==VERSION is common among both UNIX and MAC
Type: 4099 //<==SAME SV_TYPE
Platform:500
Name: MAILSRV
Version: 6.1 //<==VERSION is common among both UNIX and MAC
Type: 8493571
Platform:500
Name: WIN1019H2X64
Version: 10.0
Type: 4099 //<==SAME SV_TYPEWhere macmini is MAC and mailsrv is Unix system. sv_type of macmini and WIN1019H2X64 is the same. sv101_version_major and sv101_version_minor are the same for UNIX and MAC systems, which use SAMBA. Kindly let me know why it is? So I can differentiate these systems using predefined macros in lmserver.h.
Member 14117853 wrote:
Kindly let me know how this function works, and from where I am getting these values.
These values are set by the other side. Meaning that MACMINI-558088 broadcasts/announces itself and sets those values itself. The Netserverenum function will simply echo/repeat what MACMINI-558088 claims to be. If your SAMBA configuration file is set to announce as "Win95" then Netserverenum will print Windows 95.
Member 14117853 wrote:
sv101_version_major and sv101_version_minor are the same for UNIX and MAC systems, which use SAMBA. Kindly let me know why it is?
Did you invest any time reading my last post? I already told you that you can edit the SAMBA configuration file and modify these values. smb.conf[^] Scroll down and look at
[announce as]
This specifies what type of server nmbd(8) will announce itself as, to a network neighborhood browse list. By default this is set to Windows NT. The valid options are : "NT Server" (which can also be written as "NT"), "NT Workstation", "Win95" or "WfW" meaning Windows NT Server, Windows NT Workstation, Windows 95 and Windows for Workgroups respectively. Do not change this parameter unless you have a specific need to stop Samba appearing as an NT server as this may prevent Samba servers from participating as browser servers correctly.Default: announce as = NT Server
Example: announce as = Win95
[announce version]
This specifies the major and minor version numbers that nmbd will use when announcing itself as a server. The default is 4.9. Do not change this parameter unless you have a specific need to set a Samba server to be a downlevel server.Default: announce version = 4.9
Example: announce version = 2.0
By the way... these are not C++ issues, you are basically asking for SAMBA support in the C++ forum. Best Wishes, -David Delaune
-
Member 14117853 wrote:
Kindly let me know how this function works, and from where I am getting these values.
These values are set by the other side. Meaning that MACMINI-558088 broadcasts/announces itself and sets those values itself. The Netserverenum function will simply echo/repeat what MACMINI-558088 claims to be. If your SAMBA configuration file is set to announce as "Win95" then Netserverenum will print Windows 95.
Member 14117853 wrote:
sv101_version_major and sv101_version_minor are the same for UNIX and MAC systems, which use SAMBA. Kindly let me know why it is?
Did you invest any time reading my last post? I already told you that you can edit the SAMBA configuration file and modify these values. smb.conf[^] Scroll down and look at
[announce as]
This specifies what type of server nmbd(8) will announce itself as, to a network neighborhood browse list. By default this is set to Windows NT. The valid options are : "NT Server" (which can also be written as "NT"), "NT Workstation", "Win95" or "WfW" meaning Windows NT Server, Windows NT Workstation, Windows 95 and Windows for Workgroups respectively. Do not change this parameter unless you have a specific need to stop Samba appearing as an NT server as this may prevent Samba servers from participating as browser servers correctly.Default: announce as = NT Server
Example: announce as = Win95
[announce version]
This specifies the major and minor version numbers that nmbd will use when announcing itself as a server. The default is 4.9. Do not change this parameter unless you have a specific need to set a Samba server to be a downlevel server.Default: announce version = 4.9
Example: announce version = 2.0
By the way... these are not C++ issues, you are basically asking for SAMBA support in the C++ forum. Best Wishes, -David Delaune
Hi David, thanks for the updates.