Lines Matching defs:dhp

181 	dn_handle_t	*dhp;
187 dhp = malloc(sizeof (dn_handle_t));
188 if (dhp == NULL)
203 retval = open_file(dnpath, flags, &dhp->dh_fd);
205 free(dhp);
229 if (write_header(dhp->dh_fd, &header) == -1) {
232 (void) close_dn((void **)&dhp);
246 retval = setabyte(dhp->dh_fd, filesz - 1, 0);
249 (void) close_dn((void **)&dhp);
257 retval = setabyte(dhp->dh_fd, offsetof(dn_header_t,
261 (void) close_dn((void **)&dhp);
271 if (read_header(dhp->dh_fd, &header, B_FALSE) == -1) {
273 (void) close_dn((void **)&dhp);
280 (void) close_dn((void **)&dhp);
285 dhp->dh_netmask = header.dnh_netmask;
286 dhp->dh_oflags = flags;
288 *handlep = dhp;
295 dn_handle_t *dhp = (dn_handle_t *)*handlep;
297 if (close(dhp->dh_fd) == -1)
300 free(dhp);
320 dn_handle_t *dhp = (dn_handle_t *)handle;
330 int fd = dhp->dh_fd;
332 if ((dhp->dh_oflags & DSVC_READ) == 0)
368 recid = RECID(targetp->dn_cip.s_addr, dhp->dh_netmask);
429 if (read_rec(dhp->dh_fd, &rec, recid) == -1) {
575 dn_handle_t *dhp = (dn_handle_t *)handle;
576 int fd = dhp->dh_fd;
578 if ((dhp->dh_oflags & DSVC_WRITE) == 0)
581 retval = check_dn(dhp);
597 recid = RECID(addp->dn_cip.s_addr, dhp->dh_netmask);
700 dn_handle_t *dhp = (dn_handle_t *)handle;
701 int fd = dhp->dh_fd;
703 if ((dhp->dh_oflags & DSVC_WRITE) == 0)
706 retval = check_dn(dhp);
722 recid = RECID(delp->dn_cip.s_addr, dhp->dh_netmask);
835 dn_handle_t *dhp = (dn_handle_t *)handle;
836 int fd = dhp->dh_fd;
838 if ((dhp->dh_oflags & DSVC_WRITE) == 0)
841 retval = check_dn(dhp);
857 recid = RECID(origp->dn_cip.s_addr, dhp->dh_netmask);
872 new_recid = RECID(newp->dn_cip.s_addr, dhp->dh_netmask);
1186 check_dn(dn_handle_t *dhp)
1201 retval = getabyte(dhp->dh_fd, offsetof(dn_header_t, dnh_dirty), &dirty);
1208 if (read_header(dhp->dh_fd, &header, B_TRUE) == -1)
1221 if (write_rec(dhp->dh_fd, &header.dnh_temp, recid) == -1)
1245 if (read_rec(dhp->dh_fd, &rec, recid) == -1)
1259 if (write_rec(dhp->dh_fd, &rec, recid) == -1)
1265 if (write_header(dhp->dh_fd, &header) == -1)
1271 return (setabyte(dhp->dh_fd, offsetof(dn_header_t, dnh_dirty), 0));