Lines Matching refs:header
196 nmb->header.name_trn_id = generate_name_trn_id();
197 nmb->header.response = False;
198 nmb->header.nm_flags.recursion_desired = rec_des;
199 nmb->header.nm_flags.recursion_available = False;
200 nmb->header.nm_flags.trunc = False;
201 nmb->header.nm_flags.authoritative = False;
202 nmb->header.nm_flags.bcast = bcast;
204 nmb->header.rcode = 0;
205 nmb->header.qdcount = 1;
206 nmb->header.ancount = 0;
207 nmb->header.nscount = 0;
245 if (nmb->header.nm_flags.bcast)
281 nmb->header.opcode = NMB_NAME_QUERY_OPCODE;
282 nmb->header.arcount = 0;
284 nmb->header.nm_flags.recursion_desired = True;
288 BOOLSTR(nmb->header.nm_flags.bcast), inet_ntoa(packet->ip)));
303 nmb->header.opcode = NMB_NAME_QUERY_OPCODE;
304 nmb->header.arcount = 0;
306 nmb->header.nm_flags.recursion_desired = False;
310 BOOLSTR(nmb->header.nm_flags.bcast), inet_ntoa(packet->ip)));
324 nmb->header.opcode = NMB_NAME_REG_OPCODE;
325 nmb->header.arcount = 1;
327 nmb->header.nm_flags.recursion_desired = True;
334 BOOLSTR(nmb->header.nm_flags.bcast), inet_ntoa(packet->ip)));
351 nmb->header.opcode = NMB_NAME_MULTIHOMED_REG_OPCODE;
352 nmb->header.arcount = 1;
354 nmb->header.nm_flags.recursion_desired = True;
362 BOOLSTR(nmb->header.nm_flags.bcast), second_ip_buf ));
376 nmb->header.opcode = NMB_NAME_REFRESH_OPCODE_8;
377 nmb->header.arcount = 1;
379 nmb->header.nm_flags.recursion_desired = False;
386 BOOLSTR(nmb->header.nm_flags.bcast), inet_ntoa(packet->ip)));
400 nmb->header.opcode = NMB_NAME_RELEASE_OPCODE;
401 nmb->header.arcount = 1;
403 nmb->header.nm_flags.recursion_desired = False;
410 BOOLSTR(nmb->header.nm_flags.bcast), inet_ntoa(packet->ip)));
423 nmb->header.opcode = NMB_NAME_QUERY_OPCODE;
424 nmb->header.arcount = 0;
426 nmb->header.nm_flags.recursion_desired = False;
889 nmb->header.nm_flags.recursion_desired = False;
890 nmb->header.nm_flags.recursion_available = False;
895 nmb->header.nm_flags.recursion_desired = True;
896 nmb->header.nm_flags.recursion_available = True;
904 nmb->header.nm_flags.recursion_desired = True;
905 nmb->header.nm_flags.recursion_available = True;
909 nmb->header.nm_flags.recursion_desired = False;
910 nmb->header.nm_flags.recursion_available = False;
914 nmb->header.nm_flags.recursion_desired = False;
915 nmb->header.nm_flags.recursion_available = False;
920 nmb->header.nm_flags.recursion_desired = True;
921 nmb->header.nm_flags.recursion_available = True;
925 nmb->header.nm_flags.recursion_desired = True;
926 nmb->header.nm_flags.recursion_available = True;
940 inet_ntoa(packet.ip), orig_nmb->header.name_trn_id));
942 nmb->header.name_trn_id = orig_nmb->header.name_trn_id;
943 nmb->header.opcode = opcode;
944 nmb->header.response = True;
945 nmb->header.nm_flags.bcast = False;
946 nmb->header.nm_flags.trunc = False;
947 nmb->header.nm_flags.authoritative = True;
949 nmb->header.rcode = rcode;
950 nmb->header.qdcount = 0;
951 nmb->header.ancount = 1;
952 nmb->header.nscount = 0;
953 nmb->header.arcount = 0;
1209 if (dgram->header.msg_type != 0x10 && dgram->header.msg_type != 0x11 && dgram->header.msg_type != 0x12) {
1213 an error packet of type %x\n", nmb_namestr(&dgram->dest_name), inet_ntoa(p->ip), dgram->header.msg_type));
1307 switch (nmb->header.opcode) {
1311 if (nmb->header.ancount == 0) {
1318 if ((nmb->header.ancount != 0) && (nmb->header.ancount != 1)) {
1325 if (nmb->header.ancount == 0) {
1333 if (nmb->header.ancount != 1) {
1340 nmb->header.opcode));
1345 DEBUG(0,("Ignoring response packet with opcode %d.\n", nmb->header.opcode));
1358 switch (nmb->header.opcode) {
1363 if (nmb->header.qdcount==0 || nmb->header.arcount==0) {
1370 if ((nmb->header.qdcount == 0) || ((nmb->question.question_type != QUESTION_TYPE_NB_QUERY) &&
1378 if (nmb->header.qdcount==0 || nmb->header.arcount==0) {
1385 nmb->header.opcode));
1390 DEBUG(0,("validate_nmb_packet: Ignoring request packet with opcode %d.\n", nmb->header.opcode));
1409 if(nmb->header.response) {
1412 rrec = find_response_record( &subrec, nmb->header.name_trn_id);
1415 nmb->header.name_trn_id));
1422 nmb->header.name_trn_id));
1438 if(nmb->header.nm_flags.bcast == False)
1470 switch (nmb->header.opcode) {
1545 found for id = %hu. Ignoring packet.\n", nmb->header.name_trn_id));
1574 if(p->packet.nmb.header.response)
1805 packet->packet.nmb.header.nm_flags.bcast) {
1871 dgram->header.msg_type = unique ? 0x10 : 0x11;
1872 dgram->header.flags.node_type = M_NODE;
1873 dgram->header.flags.first = True;
1874 dgram->header.flags.more = False;
1875 dgram->header.dgm_id = generate_name_trn_id();
1876 dgram->header.source_ip = src_ip;
1877 dgram->header.source_port = DGRAM_PORT;
1878 dgram->header.dgm_length = 0; /* Let build_dgram() handle this. */
1879 dgram->header.packet_offset = 0;