Lines Matching refs:header
191 nmb->header.name_trn_id = generate_name_trn_id();
192 nmb->header.response = False;
193 nmb->header.nm_flags.recursion_desired = rec_des;
194 nmb->header.nm_flags.recursion_available = False;
195 nmb->header.nm_flags.trunc = False;
196 nmb->header.nm_flags.authoritative = False;
197 nmb->header.nm_flags.bcast = bcast;
199 nmb->header.rcode = 0;
200 nmb->header.qdcount = 1;
201 nmb->header.ancount = 0;
202 nmb->header.nscount = 0;
241 if (nmb->header.nm_flags.bcast)
278 nmb->header.opcode = NMB_NAME_QUERY_OPCODE;
279 nmb->header.arcount = 0;
281 nmb->header.nm_flags.recursion_desired = True;
285 BOOLSTR(nmb->header.nm_flags.bcast), inet_ntoa(packet->ip)));
300 nmb->header.opcode = NMB_NAME_QUERY_OPCODE;
301 nmb->header.arcount = 0;
303 nmb->header.nm_flags.recursion_desired = False;
307 BOOLSTR(nmb->header.nm_flags.bcast), inet_ntoa(packet->ip)));
321 nmb->header.opcode = NMB_NAME_REG_OPCODE;
322 nmb->header.arcount = 1;
324 nmb->header.nm_flags.recursion_desired = True;
331 BOOLSTR(nmb->header.nm_flags.bcast), inet_ntoa(packet->ip)));
348 nmb->header.opcode = NMB_NAME_MULTIHOMED_REG_OPCODE;
349 nmb->header.arcount = 1;
351 nmb->header.nm_flags.recursion_desired = True;
359 BOOLSTR(nmb->header.nm_flags.bcast), second_ip_buf ));
373 nmb->header.opcode = NMB_NAME_REFRESH_OPCODE_8;
374 nmb->header.arcount = 1;
376 nmb->header.nm_flags.recursion_desired = False;
383 BOOLSTR(nmb->header.nm_flags.bcast), inet_ntoa(packet->ip)));
397 nmb->header.opcode = NMB_NAME_RELEASE_OPCODE;
398 nmb->header.arcount = 1;
400 nmb->header.nm_flags.recursion_desired = False;
407 BOOLSTR(nmb->header.nm_flags.bcast), inet_ntoa(packet->ip)));
420 nmb->header.opcode = NMB_NAME_QUERY_OPCODE;
421 nmb->header.arcount = 0;
423 nmb->header.nm_flags.recursion_desired = False;
896 nmb->header.nm_flags.recursion_desired = False;
897 nmb->header.nm_flags.recursion_available = False;
902 nmb->header.nm_flags.recursion_desired = True;
903 nmb->header.nm_flags.recursion_available = True;
911 nmb->header.nm_flags.recursion_desired = True;
912 nmb->header.nm_flags.recursion_available = True;
916 nmb->header.nm_flags.recursion_desired = False;
917 nmb->header.nm_flags.recursion_available = False;
921 nmb->header.nm_flags.recursion_desired = False;
922 nmb->header.nm_flags.recursion_available = False;
927 nmb->header.nm_flags.recursion_desired = True;
928 nmb->header.nm_flags.recursion_available = True;
932 nmb->header.nm_flags.recursion_desired = True;
933 nmb->header.nm_flags.recursion_available = True;
947 inet_ntoa(packet.ip), orig_nmb->header.name_trn_id));
949 nmb->header.name_trn_id = orig_nmb->header.name_trn_id;
950 nmb->header.opcode = opcode;
951 nmb->header.response = True;
952 nmb->header.nm_flags.bcast = False;
953 nmb->header.nm_flags.trunc = False;
954 nmb->header.nm_flags.authoritative = True;
956 nmb->header.rcode = rcode;
957 nmb->header.qdcount = 0;
958 nmb->header.ancount = 1;
959 nmb->header.nscount = 0;
960 nmb->header.arcount = 0;
1227 if (dgram->header.msg_type != 0x10 && dgram->header.msg_type != 0x11 && dgram->header.msg_type != 0x12) {
1231 an error packet of type %x\n", nmb_namestr(&dgram->dest_name), inet_ntoa(p->ip), dgram->header.msg_type));
1325 switch (nmb->header.opcode) {
1329 if (nmb->header.ancount == 0) {
1336 if ((nmb->header.ancount != 0) && (nmb->header.ancount != 1)) {
1343 if (nmb->header.ancount == 0) {
1351 if (nmb->header.ancount != 1) {
1358 nmb->header.opcode));
1363 DEBUG(0,("Ignoring response packet with opcode %d.\n", nmb->header.opcode));
1376 switch (nmb->header.opcode) {
1381 if (nmb->header.qdcount==0 || nmb->header.arcount==0) {
1388 if ((nmb->header.qdcount == 0) || ((nmb->question.question_type != QUESTION_TYPE_NB_QUERY) &&
1396 if (nmb->header.qdcount==0 || nmb->header.arcount==0) {
1403 nmb->header.opcode));
1408 DEBUG(0,("validate_nmb_packet: Ignoring request packet with opcode %d.\n", nmb->header.opcode));
1427 if(nmb->header.response) {
1430 rrec = find_response_record( &subrec, nmb->header.name_trn_id);
1433 nmb->header.name_trn_id));
1440 nmb->header.name_trn_id));
1456 if(nmb->header.nm_flags.bcast == False)
1488 switch (nmb->header.opcode) {
1563 found for id = %hu. Ignoring packet.\n", nmb->header.name_trn_id));
1592 if(p->packet.nmb.header.response)
1817 packet->packet.nmb.header.name_trn_id)) {
1821 packet->packet.dgram.header.dgm_id)) {
1843 p->packet_id = packet->packet.nmb.header.name_trn_id;
1845 p->packet_id = packet->packet.dgram.header.dgm_id;
2004 if (packet->packet.nmb.header.nm_flags.bcast) {
2070 dgram->header.msg_type = unique ? 0x10 : 0x11;
2071 dgram->header.flags.node_type = M_NODE;
2072 dgram->header.flags.first = True;
2073 dgram->header.flags.more = False;
2074 dgram->header.dgm_id = generate_name_trn_id();
2075 dgram->header.source_ip = src_ip;
2076 dgram->header.source_port = DGRAM_PORT;
2077 dgram->header.dgm_length = 0; /* Let build_dgram() handle this. */
2078 dgram->header.packet_offset = 0;