+++ /dev/null
-<samba:parameter name="announce version"
- context="G"
- developer="1"
- type="string"
- xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
-<description>
- <para>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.</para>
-</description>
-<value type="default">4.9</value>
-<value type="example">2.0</value>
-</samba:parameter>
void lp_remove_service(int snum);
void lp_copy_service(int snum, const char *new_name);
int lp_default_server_announce(void);
-int lp_major_announce_version(void);
-int lp_minor_announce_version(void);
void lp_set_name_resolve_order(const char *new_order);
const char *lp_printername(int snum);
void lp_set_logfile(const char *name);
* This may change again in Samba-3.0 after further testing. JHT
*/
-#define DEFAULT_MAJOR_VERSION 0x04
-#define DEFAULT_MINOR_VERSION 0x09
+#define SAMBA_MAJOR_NBT_ANNOUNCE_VERSION 0x04
+#define SAMBA_MINOR_NBT_ANNOUNCE_VERSION 0x09
/* Browser Election Values */
#define BROWSER_ELECTION_VERSION 0x010f
i.sv101_platform_id = PLATFORM_ID_NT;
i.sv101_name = lp_netbios_name();
- i.sv101_version_major = lp_major_announce_version();
- i.sv101_version_minor = lp_minor_announce_version();
+ i.sv101_version_major = SAMBA_MAJOR_NBT_ANNOUNCE_VERSION;
+ i.sv101_version_minor = SAMBA_MINOR_NBT_ANNOUNCE_VERSION;
i.sv101_type = lp_default_server_announce();
i.sv101_comment = lp_serverstring();
strupper_m(upper_server_name);
push_string_check(p+5, upper_server_name, 16, STR_ASCII|STR_TERMINATE);
- SCVAL(p,21,lp_major_announce_version()); /* Major version. */
- SCVAL(p,22,lp_minor_announce_version()); /* Minor version. */
+ SCVAL(p,21,SAMBA_MAJOR_NBT_ANNOUNCE_VERSION); /* Major version. */
+ SCVAL(p,22,SAMBA_MINOR_NBT_ANNOUNCE_VERSION); /* Minor version. */
SIVAL(p,23,server_type & ~SV_TYPE_LOCAL_LIST_ONLY);
/* Browse version: got from NT/AS 4.00 - Value defined in smb.h (JHT). */
SSVAL(p,0,announce_type);
SIVAL(p,2,server_type & ~SV_TYPE_LOCAL_LIST_ONLY);
- SCVAL(p,6,lp_major_announce_version()); /* Major version. */
- SCVAL(p,7,lp_minor_announce_version()); /* Minor version. */
+ SCVAL(p,6,SAMBA_MAJOR_NBT_ANNOUNCE_VERSION); /* Major version. */
+ SCVAL(p,7,SAMBA_MINOR_NBT_ANNOUNCE_VERSION); /* Minor version. */
SSVAL(p,8,announce_interval); /* In seconds - according to spec. */
p += 10;
char *szSocketAddress;
bool bNmbdBindExplicitBroadcast;
char *szNISHomeMapName;
- char *szAnnounceVersion; /* This is initialised in init_globals */
char *szWorkgroup;
char *szNetbiosName;
char **szNetbiosAliases;
.enum_list = NULL,
.flags = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE,
},
- {
- .label = "announce version",
- .type = P_STRING,
- .p_class = P_GLOBAL,
- .ptr = &Globals.szAnnounceVersion,
- .special = NULL,
- .enum_list = NULL,
- .flags = FLAG_ADVANCED,
- },
{
.label = "map acl inherit",
.type = P_BOOL,
}
string_set(&Globals.szServerString, s);
SAFE_FREE(s);
- if (asprintf(&s, "%d.%d", DEFAULT_MAJOR_VERSION,
- DEFAULT_MINOR_VERSION) < 0) {
- smb_panic("init_globals: ENOMEM");
- }
- string_set(&Globals.szAnnounceVersion, s);
- SAFE_FREE(s);
#ifdef DEVELOPER
string_set(&Globals.szPanicAction, "/bin/sleep 999999999");
#endif
FN_GLOBAL_LIST(lp_wins_server_list, szWINSservers)
FN_GLOBAL_LIST(lp_interfaces, szInterfaces)
FN_GLOBAL_STRING(lp_nis_home_map_name, szNISHomeMapName)
-static FN_GLOBAL_STRING(lp_announce_version, szAnnounceVersion)
FN_GLOBAL_LIST(lp_netbios_aliases, szNetbiosAliases)
/* FN_GLOBAL_STRING(lp_passdb_backend, szPassdbBackend)
* lp_passdb_backend() should be replace by the this macro again after
return default_server_announce;
}
-/*******************************************************************
- Split the announce version into major and minor numbers.
-********************************************************************/
-
-int lp_major_announce_version(void)
-{
- static bool got_major = False;
- static int major_version = DEFAULT_MAJOR_VERSION;
- char *vers;
- char *p;
-
- if (got_major)
- return major_version;
-
- got_major = True;
- if ((vers = lp_announce_version()) == NULL)
- return major_version;
-
- if ((p = strchr_m(vers, '.')) == 0)
- return major_version;
-
- *p = '\0';
- major_version = atoi(vers);
- return major_version;
-}
-
-int lp_minor_announce_version(void)
-{
- static bool got_minor = False;
- static int minor_version = DEFAULT_MINOR_VERSION;
- char *vers;
- char *p;
-
- if (got_minor)
- return minor_version;
-
- got_minor = True;
- if ((vers = lp_announce_version()) == NULL)
- return minor_version;
-
- if ((p = strchr_m(vers, '.')) == 0)
- return minor_version;
-
- p++;
- minor_version = atoi(p);
- return minor_version;
-}
-
/***********************************************************
Set the global name resolution order (used in smbclient).
************************************************************/
regval_ctr_addvalue_sz(values, "SystemRoot", sysroot_string);
- fstr_sprintf(sysversion, "%d.%d", lp_major_announce_version(),
- lp_minor_announce_version());
+ fstr_sprintf(sysversion, "%d.%d", SAMBA_MAJOR_NBT_ANNOUNCE_VERSION,
+ SAMBA_MINOR_NBT_ANNOUNCE_VERSION);
regval_ctr_addvalue_sz(values, "CurrentVersion", sysversion);
info102->platform_id = PLATFORM_ID_NT;
info102->server_name = lp_netbios_name();
- info102->version_major = lp_major_announce_version();
- info102->version_minor = lp_minor_announce_version();
+ info102->version_major = SAMBA_MAJOR_NBT_ANNOUNCE_VERSION;
+ info102->version_minor = SAMBA_MINOR_NBT_ANNOUNCE_VERSION;
info102->server_type = lp_default_server_announce();
info102->comment = string_truncate(lp_serverstring(),
MAX_SERVER_STRING_LENGTH);
info101->platform_id = PLATFORM_ID_NT;
info101->server_name = lp_netbios_name();
- info101->version_major = lp_major_announce_version();
- info101->version_minor = lp_minor_announce_version();
+ info101->version_major = SAMBA_MAJOR_NBT_ANNOUNCE_VERSION;
+ info101->version_minor = SAMBA_MINOR_NBT_ANNOUNCE_VERSION;
info101->server_type = lp_default_server_announce();
info101->comment = string_truncate(lp_serverstring(),
MAX_SERVER_STRING_LENGTH);
}
info100->platform_id = PLATFORM_ID_NT; /* unknown */
- info100->version_major = lp_major_announce_version();
- info100->version_minor = lp_minor_announce_version();
+ info100->version_major = SAMBA_MAJOR_NBT_ANNOUNCE_VERSION;
+ info100->version_minor = SAMBA_MINOR_NBT_ANNOUNCE_VERSION;
info100->server_name = talloc_asprintf_strupper_m(
info100, "%s", lp_netbios_name());
}
info101->platform_id = PLATFORM_ID_NT; /* unknown */
- info101->version_major = lp_major_announce_version();
- info101->version_minor = lp_minor_announce_version();
+ info101->version_major = SAMBA_MAJOR_NBT_ANNOUNCE_VERSION;
+ info101->version_minor = SAMBA_MINOR_NBT_ANNOUNCE_VERSION;
info101->server_name = talloc_asprintf_strupper_m(
info101, "%s", lp_netbios_name());
}
info102->platform_id = PLATFORM_ID_NT; /* unknown */
- info102->version_major = lp_major_announce_version();
- info102->version_minor = lp_minor_announce_version();
+ info102->version_major = SAMBA_MAJOR_NBT_ANNOUNCE_VERSION;
+ info102->version_minor = SAMBA_MINOR_NBT_ANNOUNCE_VERSION;
info102->server_name = talloc_asprintf_strupper_m(
info102, "%s", lp_netbios_name());
}
p += 4;
- SCVAL(p,0,lp_major_announce_version()); /* system version - e.g 4 in 4.1 */
- SCVAL(p,1,lp_minor_announce_version()); /* system version - e.g .1 in 4.1 */
+ SCVAL(p,0,SAMBA_MAJOR_NBT_ANNOUNCE_VERSION); /* system version - e.g 4 in 4.1 */
+ SCVAL(p,1,SAMBA_MINOR_NBT_ANNOUNCE_VERSION); /* system version - e.g .1 in 4.1 */
p += 2;
SIVAL(p,0,PTR_DIFF(p2,*rdata));