Lines Matching refs:cachep
2546 struct portmap_cache *cachep, *prev, *next = NULL, *cp; in portmap_cache_lookup() local
2566 for (cachep = portmap_cache_head; cachep; in portmap_cache_lookup()
2567 cachep = cachep->cache_next) { in portmap_cache_lookup()
2568 if (timenow > cachep->cache_time) { in portmap_cache_lookup()
2614 if (cachep->cache_hostname == NULL || in portmap_cache_lookup()
2615 prog != cachep->cache_prog || vers != cachep->cache_vers || in portmap_cache_lookup()
2616 strcmp(nconf->nc_proto, cachep->cache_proto) != 0 || in portmap_cache_lookup()
2617 strcmp(nconf->nc_protofmly, cachep->cache_protofmly) != 0 || in portmap_cache_lookup()
2618 strcmp(hostname, cachep->cache_hostname) != 0) in portmap_cache_lookup()
2626 addrp->len = cachep->cache_srv_addr.len; in portmap_cache_lookup()
2627 memcpy(addrp->buf, cachep->cache_srv_addr.buf, addrp->len); in portmap_cache_lookup()
2640 struct portmap_cache *cachep; in portmap_cache_enter() local
2646 cachep = malloc(sizeof (struct portmap_cache)); in portmap_cache_enter()
2647 if (cachep == NULL) in portmap_cache_enter()
2649 memset((char *)cachep, 0, sizeof (*cachep)); in portmap_cache_enter()
2653 cachep->cache_hostname = cachep->cache_small_hosts; in portmap_cache_enter()
2655 cachep->cache_hostname = malloc(hostnamelen + 1); in portmap_cache_enter()
2656 if (cachep->cache_hostname == NULL) in portmap_cache_enter()
2659 strcpy(cachep->cache_hostname, hostname); in portmap_cache_enter()
2662 cachep->cache_proto = cachep->cache_small_proto; in portmap_cache_enter()
2664 cachep->cache_proto = malloc(protolen + 1); in portmap_cache_enter()
2665 if (cachep->cache_proto == NULL) in portmap_cache_enter()
2670 cachep->cache_protofmly = cachep->cache_small_protofmly; in portmap_cache_enter()
2672 cachep->cache_protofmly = malloc(protofmlylen + 1); in portmap_cache_enter()
2673 if (cachep->cache_protofmly == NULL) in portmap_cache_enter()
2677 strcpy(cachep->cache_proto, nconf->nc_proto); in portmap_cache_enter()
2678 cachep->cache_prog = prog; in portmap_cache_enter()
2679 cachep->cache_vers = vers; in portmap_cache_enter()
2680 cachep->cache_time = timenow + portmap_cache_valid_time; in portmap_cache_enter()
2681 cachep->cache_srv_addr.len = addrp->len; in portmap_cache_enter()
2682 cachep->cache_srv_addr.buf = malloc(addrp->len); in portmap_cache_enter()
2683 if (cachep->cache_srv_addr.buf == NULL) in portmap_cache_enter()
2685 memcpy(cachep->cache_srv_addr.buf, addrp->buf, addrp->maxlen); in portmap_cache_enter()
2686 cachep->cache_prev = NULL; in portmap_cache_enter()
2698 cachep->cache_next = portmap_cache_head; in portmap_cache_enter()
2700 portmap_cache_head->cache_prev = cachep; in portmap_cache_enter()
2701 portmap_cache_head = cachep; in portmap_cache_enter()
2707 if (cachep->cache_srv_addr.buf) in portmap_cache_enter()
2708 free(cachep->cache_srv_addr.buf); in portmap_cache_enter()
2709 if (cachep->cache_proto && protolen > SMALL_PROTONAME) in portmap_cache_enter()
2710 free(cachep->cache_proto); in portmap_cache_enter()
2711 if (cachep->cache_hostname && hostnamelen > SMALL_HOSTNAME) in portmap_cache_enter()
2712 free(cachep->cache_hostname); in portmap_cache_enter()
2713 if (cachep->cache_protofmly && protofmlylen > SMALL_PROTOFMLYNAME) in portmap_cache_enter()
2714 free(cachep->cache_protofmly); in portmap_cache_enter()
2715 if (cachep) in portmap_cache_enter()
2716 free(cachep); in portmap_cache_enter()
2717 cachep = NULL; in portmap_cache_enter()