How is to get workgroup name from node (host) Multi-homed Registration request packet (Nmbd) ?

CpServiceSPb . cpservicespb at gmail.com
Sun Jan 18 11:48:26 MST 2015


 There is Ubuntu 14.04 LTS x32, Samba4 4.1.14 is installed at. It acts as
Wins also.
There are some Windows XP/7 clients in the network and some workgroups
either.
Clients send Wins Multi-homed request packets with hosts and workgroups
names to Samba4 server to register such names (add it also) to subnet.

There is such as packet with host name, not with workgroup name:

  nmb packet from 192.168.0.201(137) header: id=47515 opcode=Multi-homed
Registration(15) response=No
      header: flags: bcast=No rec_avail=No rec_des=Yes trunc=No auth=No
      header: rcode=0 qdcount=1 ancount=0 nscount=0 arcount=1
      question: q_name=Host<00> q_type=32 q_class=1
      additional: nmb_name=Host<00> rr_type=32 rr_class=1 ttl=300000
      additional   0 char `.....   hex 60000A0A00C9

Then handling of the packet contunues by
Wins_process_multihomed_name_registration_request function.

So, I can check if it is group name request or node (host) name request,
then if it is broadcast request or unicast (Wins) .
I can get name and name type as for workgroup as for node (host) , source
IP (client IP sent request) .

But how can I get workgroup name which host belongs to, from such node
(hosts) packet ?

I need it in Nmb daemon, moreover exact in
Wins_process_multihomed_name_registration_request function.

I tried to:
struct dgram_packet *dgram = &p->packet.dgram;
nmb_namestr(&dgram->source_name)

I supposed that may be here can workgroup name be, but there are trash.

I tried also to call
status = node_status_query(talloc_tos(), &nname, &ss, &addrs, &count,
&extra);
as at nmblookup to get extra info where host and workgroup name at.
But I get always status NTSTATUS_IO_TIMEOUT.


More information about the samba-technical mailing list