I wonder if this represents a path to recovery. Zero configuration networking - Wikipedia, the free encyclopedia sounds kind of like CIFS/NetBIOS over TCP/IP B node behavior - without the Microsoft-pathology.
Implementing CIFS: NBT
1.3.1.2 Fully Qualified NBT Names
Now that we’ve managed to convert the NetBIOS name into a DNS-aligned form, it is time to combine it with the NBT Scope ID. The result will be a fully-qualified NBT address, which we will call the “NBT Name”. To be pedantic, when the RFCs talk about First Level Encoding, this fully qualified form is what they really mean.
As expected, the syntax of the Scope ID follows the DNS recommendations given in RFC 883 (and repeated in RFC 1035). That is, a Scope ID looks like a DNS name. So, if the Scope ID is cat.org, and the NetBIOS name is Neko, the resultant NBT name would be:
EOGFGLGPCACACACACACACACACACACACA.CAT.ORG
Imagine typing that into your web browser. This is why the RFC 1001/1002 scheme for merging the NBNS with the DNS never took hold.
Just for cheep bragging rights, this is my answer to the C code in Implementing CIFS: NBT It has two advantages, IMO. 1) it is cleaner. 2) it works. DomainName can be replace by std::string without impacting the example.
DomainName NBTName::levelOneEncoding() const {
// RFC 1001, Section 14.1.
std::string result(32,'A');
std::string paddedName = 16 > _name.length()
? _name + std::string(16 - _name.length(),' ')
: _name.substr(0,16);
for(int i = 0; i < paddedName.length(); ++i ) {
result[2 * i ] += ((paddedName* >>4) & 0x0F);
result[2 * i + 1] += ( paddedName* & 0x0F);
}
return result+"."+std::string(_scope);
}
NBT Listing 1.1
#ifndef uchar
#define uchar unsigned char
#endif /* uchar */
uchar *L1_Encode( uchar *dst, const uchar *name )
{
int i = 0;
int j = 0;
/* Encode the name. */
while( ('\0' != name*) && (i < 16) )
{
dst[j++] = 'A' + ((name* & 0xF0) >> 4);
dst[j++] = 'A' + (name* & 0x0F);
}
/* Encode the padding bytes. */
while( j < 32 )
{
dst[j++] = 'C';
dst[j++] = 'A';
}
/* Terminate the string. */
dst[32] = '\0';
return( dst );
} /* L1_Encode */
$Revision: 1.12 $
$Date: 2003/02/18 21:43:58 $