{
# Normally this should not be set as the automatic negotiation phase in the SMB protocol takes care of choosing the appropiate protocol.
$OUT = "";
our %ProtocolOrder = ( CORE => 1, # samba client default without explicit option; not available for server
COREPLUS => 2, # not available for server
LANMAN1 => 3, #samba server default without explicit option
LANMAN2 => 4,
NT1 => 5, # CIFS or SMB1
SMB2_02 => 6,
SMB2_10 => 7,
SMB2 => 7, # yes SMB2 default to 2_10
SMB2_22 => 8,
SMB2_24 => 9,
);
$serverMinProt = $smb{ServerMinProtocol} || "LANMAN1";
$serverMaxProt = $smb{ServerMaxProtocol} || "SMB2";
#checking option is possible
$serverMinProt = ( exists($ProtocolOrder{$serverMinProt}) ) ? $serverMinProt : "LANMAN1";
$serverMaxProt = ( exists($ProtocolOrder{$serverMaxProt}) && $ProtocolOrder{$serverMaxProt} >= 3) ? $serverMaxProt : "SMB2";
$serverMinProt = ( $ProtocolOrder{$serverMaxProt} >= $ProtocolOrder{$serverMinProt} ) ? $serverMinProt : $serverMaxProt;
$OUT .= "min protocol = $serverMinProt\n";
$OUT .= "max protocol = $serverMaxProt";
}
