Lines Matching refs:pdom

149 	register struct domain *pdom;  in broadcast_proc_exit()  local
180 for (pdom = known_domains; pdom != (struct domain *)NULL; in broadcast_proc_exit()
181 pdom = pdom->dom_pnext) { in broadcast_proc_exit()
183 if (pdom->dom_broadcaster_pid == pid) { in broadcast_proc_exit()
186 "ypbind event_handler: got match %s\n", pdom->dom_name); in broadcast_proc_exit()
189 broadcast_setup(pdom); in broadcast_proc_exit()
191 if (pdom->broadcaster_pipe != 0) { in broadcast_proc_exit()
192 xdr_destroy(&(pdom->broadcaster_xdr)); in broadcast_proc_exit()
193 fclose(pdom->broadcaster_pipe); in broadcast_proc_exit()
194 pdom->broadcaster_pipe = 0; in broadcast_proc_exit()
195 pdom->broadcaster_fd = -1; in broadcast_proc_exit()
197 pdom->dom_broadcaster_pid = 0; in broadcast_proc_exit()
207 broadcast_setup(pdom) in broadcast_setup() argument
208 struct domain *pdom; in broadcast_setup()
213 if (pdom->broadcaster_pipe) {
214 pdom->dom_report_success = -1;
215 if (xdr_ypbind_setdom(&(pdom->broadcaster_xdr), &req)) {
222 gettimeofday(&(pdom->lastping), NULL);
962 register struct domain *pdom; local
965 for (pdom = known_domains; pdom != (struct domain *)NULL;
966 pdom = pdom->dom_pnext) {
967 if (strcmp(pname, pdom->dom_name) == 0)
968 return (pdom);
973 if (pdom = (struct domain *)calloc(1, sizeof (struct domain))) {
974 pdom->dom_name = strdup(pname);
975 if (pdom->dom_name == NULL) {
976 free((char *)pdom);
981 pdom->dom_pnext = known_domains;
982 known_domains = pdom;
983 pdom->dom_boundp = FALSE;
984 pdom->dom_vers = YPVERS; /* This doesn't talk to old ypserv */
985 pdom->dom_binding = NULL;
986 pdom->dom_error = YPBIND_ERR_NOSERV;
987 pdom->ping_clnt = (CLIENT *)NULL;
988 pdom->dom_report_success = -1;
989 pdom->dom_broadcaster_pid = 0;
990 pdom->broadcaster_pipe = 0;
991 pdom->bindfile = -1;
992 pdom->lastping.tv_sec = 0;
993 pdom->lastping.tv_usec = 0; /* require ping */
994 pdom->cache_fp = 0;
995 sprintf(buf, "%s/%s/cache_binding", BINDING, pdom->dom_name);
996 pdom->cache_file = strdup(buf);
1007 return (pdom);
1011 ypbind_ping(pdom) in ypbind_ping() argument
1012 struct domain *pdom; in ypbind_ping()
1018 if (pdom->dom_boundp == FALSE)
1020 vers = pdom->dom_vers;
1022 if (pdom->ping_clnt == (CLIENT *) NULL) {
1023 pdom->ping_clnt = __nis_clnt_create(RPC_ANYFD,
1024 pdom->dom_binding->ypbind_nconf, 0,
1025 pdom->dom_binding->ypbind_svcaddr, 0,
1029 if (pdom->ping_clnt == (CLIENT *) NULL) {
1032 pdom->dom_boundp = FALSE;
1033 pdom->dom_error = YPBIND_ERR_NOSERV;
1043 if (clnt_call(pdom->ping_clnt,
1045 (char *)&pdom->dom_name, xdr_int, (char *)&isok,
1047 pdom->dom_boundp = isok;
1048 pdom->dom_binding->ypbind_lo_vers = vers;
1049 pdom->dom_binding->ypbind_hi_vers = vers;
1053 pdom->dom_binding->ypbind_lo_vers,
1054 pdom->dom_binding->ypbind_hi_vers);
1057 clnt_perror(pdom->ping_clnt, "ping");
1058 pdom->dom_boundp = FALSE;
1059 pdom->dom_error = YPBIND_ERR_NOSERV;
1061 (void) gettimeofday(&(pdom->lastping), NULL);
1062 if (pdom->ping_clnt)
1063 clnt_destroy(pdom->ping_clnt);
1064 pdom->ping_clnt = (CLIENT *)NULL;
1065 if (pdom->dom_boundp)
1066 cache_binding(pdom);
1261 cache_binding(pdom) in cache_binding() argument
1262 struct domain *pdom; in cache_binding()
1273 if (pdom->cache_file == 0)
1284 if (pdom->cache_fp) {
1285 fclose(pdom->cache_fp); /* automatically unlocks */
1286 unlink(pdom->cache_file);
1287 pdom->cache_fp = 0;
1290 fd = open(pdom->cache_file, O_CREAT|O_WRONLY, 0444);
1294 pdom->cache_fp = fdopen(fd, "w");
1295 if (pdom->cache_fp == 0) {
1300 xdrstdio_create(&xdrs, pdom->cache_fp, XDR_ENCODE);
1302 resp.ypbind_resp_u.ypbind_bindinfo = pdom->dom_binding;
1306 unlink(pdom->cache_file);
1307 fclose(pdom->cache_fp);
1308 pdom->cache_fp = 0;
1317 unlink(pdom->cache_file);
1318 fclose(pdom->cache_fp);
1319 pdom->cache_fp = 0;
1324 uncache_binding(pdom) in uncache_binding() argument
1325 struct domain *pdom; in uncache_binding()
1330 if (pdom->cache_fp != 0) {
1331 unlink(pdom->cache_file);
1332 fclose(pdom->cache_fp);
1333 pdom->cache_fp = 0;
1451 struct domain *pdom; in clean_cache() local
1457 for (pdom = known_domains; pdom != (struct domain *)NULL; in clean_cache()
1458 pdom = pdom->dom_pnext) { in clean_cache()
1459 if (pdom->cache_file) in clean_cache()
1460 unlink(pdom->cache_file); in clean_cache()