Lines Matching defs:binding

52 #define	BFSIZE	(YPMAXDOMAIN + 32)	/* size of binding file */
103 * It also protects all of the fields within a domain binding except
107 * To avoid one thread freeing a domain binding while another is using
108 * the binding, we maintain a reference count for each binding. The
110 * __yp_rel_binding() when it has finished using the binding (which
112 * when a thread tries to free a binding, the need_free flag is set and
141 * The domain-server binding will not exist after the call to this function.
142 * All resources associated with the binding will be freed.
161 * have already gotten a binding by talking to ypbind and
162 * the binding is not good.
166 * reload the binding from it. But that is too much work
224 * code. This returns TRUE and points the binding parameter at the found
225 * dom_binding if the binding is found and the socket looks OK, and FALSE
232 check_binding(char *domain, struct dom_binding **binding)
250 *binding = pdomb;
257 * If we can, then we load the binding (i.e., add it to our
264 *binding = pdomb;
271 * This routine adds a binding for a particular server to our
274 * any other error, we return 0. We have to malloc the binding
285 struct ypbind_binding *binding = 0;
306 binding = malloc(sizeof (struct ypbind_binding));
307 if (binding == 0)
310 binding->ypbind_hi_vers = YPVERS;
311 binding->ypbind_lo_vers = YPVERS;
312 binding->ypbind_nconf = nconf;
313 binding->ypbind_svcaddr = svcaddr;
314 binding->ypbind_servername = (char *)strdup(addr);
315 if (binding->ypbind_servername == 0)
319 resp.ypbind_resp_u.ypbind_bindinfo = binding;
336 if (binding) {
337 if (binding->ypbind_servername)
338 free(binding->ypbind_servername);
339 free(binding);
358 * This allocates some memory for a domain binding, initialize it, and
450 * This allocates some memory for a domain binding, initialize it, and
461 * Note that the binding is not cached. The caller has to free the binding
537 struct dom_binding **binding, /* if result==0, ptr to dom_binding */
541 struct dom_binding *pdomb; /* Ptr to new domain binding */
559 if (check_binding(domain, binding)) {
563 * then use the binding.
565 if (!(*binding)->cache_bad && check_rdev(*binding)) {
566 (*binding)->ref_count += 1;
577 * the binding.
580 * yp_unbind to remove the binding (we set cache_bad
582 * call check_binding to reload the binding from the
585 if ((*binding)->cache_bad) {
588 (*binding)->cache_bad = 1;
592 if (check_binding(domain, binding)) {
593 (*binding)->ref_count += 1;
651 *binding = pdomb; /* Return ptr to the binding entry */
674 struct dom_binding **binding) /* if result == 0, ptr to dom_binding */
677 return (__yp_dobind_cflookup(domain, binding, 1));
681 __yp_rel_binding(struct dom_binding *binding)
684 binding->ref_count -= 1;
685 if (binding->need_free && binding->ref_count == 0)
686 free_dom_binding(binding);
701 * This returns an uncached binding which the caller has to free using
707 struct dom_binding **binding, /* if result==0, ptr to dom_binding */
710 struct dom_binding *pdomb; /* Ptr to new domain binding */
729 * Check for existing bindings and use the information in the binding
732 if (check_binding(domain, binding)) {
737 if ((*binding)->cache_bad) {
741 (*binding)->dom_binding,
749 *binding = pdomb; /* Return ptr to the binding entry */
807 *binding = pdomb; /* Return ptr to the binding entry */
830 struct dom_binding **binding) /* if result==0, ptr to dom_binding */
833 return (__yp_dobind_rsvdport_cflookup(domain, binding, 1));
844 struct dom_binding *binding;
847 res = __yp_dobind(domain, &binding);
849 __yp_rel_binding(binding);