• Home
  • Raw
  • Download

Lines Matching refs:tp

326 	struct enamemem *tp;  in lookup_emem()  local
332 tp = &enametable[(i ^ j) & (HASHNAMESIZE-1)]; in lookup_emem()
333 while (tp->e_nxt) in lookup_emem()
334 if (tp->e_addr0 == i && in lookup_emem()
335 tp->e_addr1 == j && in lookup_emem()
336 tp->e_addr2 == k) in lookup_emem()
337 return tp; in lookup_emem()
339 tp = tp->e_nxt; in lookup_emem()
340 tp->e_addr0 = i; in lookup_emem()
341 tp->e_addr1 = j; in lookup_emem()
342 tp->e_addr2 = k; in lookup_emem()
343 tp->e_nxt = (struct enamemem *)calloc(1, sizeof(*tp)); in lookup_emem()
344 if (tp->e_nxt == NULL) in lookup_emem()
347 return tp; in lookup_emem()
358 struct enamemem *tp; in lookup_bytestring() local
372 tp = &bytestringtable[(i ^ j) & (HASHNAMESIZE-1)]; in lookup_bytestring()
373 while (tp->e_nxt) in lookup_bytestring()
374 if (tp->e_addr0 == i && in lookup_bytestring()
375 tp->e_addr1 == j && in lookup_bytestring()
376 tp->e_addr2 == k && in lookup_bytestring()
377 memcmp((const char *)bs, (const char *)(tp->e_bs), nlen) == 0) in lookup_bytestring()
378 return tp; in lookup_bytestring()
380 tp = tp->e_nxt; in lookup_bytestring()
382 tp->e_addr0 = i; in lookup_bytestring()
383 tp->e_addr1 = j; in lookup_bytestring()
384 tp->e_addr2 = k; in lookup_bytestring()
386 tp->e_bs = (u_char *) calloc(1, nlen + 1); in lookup_bytestring()
387 if (tp->e_bs == NULL) in lookup_bytestring()
390 memcpy(tp->e_bs, bs, nlen); in lookup_bytestring()
391 tp->e_nxt = (struct enamemem *)calloc(1, sizeof(*tp)); in lookup_bytestring()
392 if (tp->e_nxt == NULL) in lookup_bytestring()
395 return tp; in lookup_bytestring()
405 struct enamemem *tp; in lookup_nsap() local
416 tp = &nsaptable[(i ^ j) & (HASHNAMESIZE-1)]; in lookup_nsap()
417 while (tp->e_nxt) in lookup_nsap()
418 if (tp->e_addr0 == i && in lookup_nsap()
419 tp->e_addr1 == j && in lookup_nsap()
420 tp->e_addr2 == k && in lookup_nsap()
421 tp->e_nsap[0] == nlen && in lookup_nsap()
423 (char *)&(tp->e_nsap[1]), nlen) == 0) in lookup_nsap()
424 return tp; in lookup_nsap()
426 tp = tp->e_nxt; in lookup_nsap()
427 tp->e_addr0 = i; in lookup_nsap()
428 tp->e_addr1 = j; in lookup_nsap()
429 tp->e_addr2 = k; in lookup_nsap()
430 tp->e_nsap = (u_char *)malloc(nlen + 1); in lookup_nsap()
431 if (tp->e_nsap == NULL) in lookup_nsap()
433 memcpy((char *)tp->e_nsap, (const char *)nsap, nlen + 1); in lookup_nsap()
434 tp->e_nxt = (struct enamemem *)calloc(1, sizeof(*tp)); in lookup_nsap()
435 if (tp->e_nxt == NULL) in lookup_nsap()
438 return tp; in lookup_nsap()
447 struct protoidmem *tp; in lookup_protoid() local
454 tp = &protoidtable[(i ^ j) & (HASHNAMESIZE-1)]; in lookup_protoid()
455 while (tp->p_nxt) in lookup_protoid()
456 if (tp->p_oui == i && tp->p_proto == j) in lookup_protoid()
457 return tp; in lookup_protoid()
459 tp = tp->p_nxt; in lookup_protoid()
460 tp->p_oui = i; in lookup_protoid()
461 tp->p_proto = j; in lookup_protoid()
462 tp->p_nxt = (struct protoidmem *)calloc(1, sizeof(*tp)); in lookup_protoid()
463 if (tp->p_nxt == NULL) in lookup_protoid()
466 return tp; in lookup_protoid()
474 register struct enamemem *tp; in etheraddr_string() local
478 tp = lookup_emem(ep); in etheraddr_string()
479 if (tp->e_name) in etheraddr_string()
480 return (tp->e_name); in etheraddr_string()
492 tp->e_name = strdup(buf2); in etheraddr_string()
493 return (tp->e_name); in etheraddr_string()
512 tp->e_name = strdup(buf); in etheraddr_string()
513 return (tp->e_name); in etheraddr_string()
522 register struct enamemem *tp; in le64addr_string() local
525 tp = lookup_bytestring(ep, len); in le64addr_string()
526 if (tp->e_name) in le64addr_string()
527 return (tp->e_name); in le64addr_string()
539 tp->e_name = strdup(buf); in le64addr_string()
541 return (tp->e_name); in le64addr_string()
549 register struct enamemem *tp; in linkaddr_string() local
560 tp = lookup_bytestring(ep, len); in linkaddr_string()
561 if (tp->e_name) in linkaddr_string()
562 return (tp->e_name); in linkaddr_string()
564 tp->e_name = cp = (char *)malloc(len*3); in linkaddr_string()
565 if (tp->e_name == NULL) in linkaddr_string()
575 return (tp->e_name); in linkaddr_string()
582 register struct hnamemem *tp; in etherproto_string() local
586 for (tp = &eprototable[i & (HASHNAMESIZE-1)]; tp->nxt; tp = tp->nxt) in etherproto_string()
587 if (tp->addr == i) in etherproto_string()
588 return (tp->name); in etherproto_string()
590 tp->addr = i; in etherproto_string()
591 tp->nxt = newhnamemem(); in etherproto_string()
600 tp->name = strdup(buf); in etherproto_string()
601 return (tp->name); in etherproto_string()
609 register struct protoidmem *tp; in protoid_string() local
612 tp = lookup_protoid(pi); in protoid_string()
613 if (tp->p_name) in protoid_string()
614 return tp->p_name; in protoid_string()
627 tp->p_name = strdup(buf); in protoid_string()
628 return (tp->p_name); in protoid_string()
637 register struct enamemem *tp; in isonsap_string() local
642 tp = lookup_nsap(nsap); in isonsap_string()
643 if (tp->e_name) in isonsap_string()
644 return tp->e_name; in isonsap_string()
646 tp->e_name = cp = (char *)malloc(sizeof("xx.xxxx.xxxx.xxxx.xxxx.xxxx.xxxx.xxxx.xxxx.xxxx.xx")); in isonsap_string()
659 return (tp->e_name); in isonsap_string()
665 register struct hnamemem *tp; in tcpport_string() local
669 for (tp = &tporttable[i & (HASHNAMESIZE-1)]; tp->nxt; tp = tp->nxt) in tcpport_string()
670 if (tp->addr == i) in tcpport_string()
671 return (tp->name); in tcpport_string()
673 tp->addr = i; in tcpport_string()
674 tp->nxt = newhnamemem(); in tcpport_string()
677 tp->name = strdup(buf); in tcpport_string()
678 return (tp->name); in tcpport_string()
684 register struct hnamemem *tp; in udpport_string() local
688 for (tp = &uporttable[i & (HASHNAMESIZE-1)]; tp->nxt; tp = tp->nxt) in udpport_string()
689 if (tp->addr == i) in udpport_string()
690 return (tp->name); in udpport_string()
692 tp->addr = i; in udpport_string()
693 tp->nxt = newhnamemem(); in udpport_string()
696 tp->name = strdup(buf); in udpport_string()
697 return (tp->name); in udpport_string()
704 register struct hnamemem *tp; in ipxsap_string() local
708 for (tp = &ipxsaptable[i & (HASHNAMESIZE-1)]; tp->nxt; tp = tp->nxt) in ipxsap_string()
709 if (tp->addr == i) in ipxsap_string()
710 return (tp->name); in ipxsap_string()
712 tp->addr = i; in ipxsap_string()
713 tp->nxt = newhnamemem(); in ipxsap_string()
722 tp->name = strdup(buf); in ipxsap_string()
723 return (tp->name); in ipxsap_string()
805 register struct protoidmem *tp; in init_protoidarray() local
816 tp = lookup_protoid(protoid); in init_protoidarray()
817 tp->p_name = strdup(eproto_db[i].s); in init_protoidarray()
821 tp = lookup_protoid(pl->protoid); in init_protoidarray()
823 if (tp->p_name != NULL) in init_protoidarray()
826 tp->p_name = pl->name; in init_protoidarray()
856 register struct enamemem *tp; in init_etherarray() local
867 tp = lookup_emem(ep->addr); in init_etherarray()
868 tp->e_name = strdup(ep->name); in init_etherarray()
876 tp = lookup_emem(el->addr); in init_etherarray()
878 if (tp->e_name != NULL) in init_etherarray()
891 tp->e_name = strdup(name); in init_etherarray()
895 tp->e_name = el->name; in init_etherarray()
1162 register struct hnamemem *tp; in dnaddr_string() local
1164 for (tp = &dnaddrtable[dnaddr & (HASHNAMESIZE-1)]; tp->nxt != 0; in dnaddr_string()
1165 tp = tp->nxt) in dnaddr_string()
1166 if (tp->addr == dnaddr) in dnaddr_string()
1167 return (tp->name); in dnaddr_string()
1169 tp->addr = dnaddr; in dnaddr_string()
1170 tp->nxt = newhnamemem(); in dnaddr_string()
1172 tp->name = dnnum_string(dnaddr); in dnaddr_string()
1174 tp->name = dnname_string(dnaddr); in dnaddr_string()
1176 return(tp->name); in dnaddr_string()