res_mkquery.c (7c478bd9) | res_mkquery.c (6a1c6faa) |
---|---|
1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License, Version 1.0 only 6 * (the "License"). You may not use this file except in compliance 7 * with the License. 8 * --- 6 unchanged lines hidden (view full) --- 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16 * If applicable, add the following below this CDDL HEADER, with the 17 * fields enclosed by brackets "[]" replaced with your own identifying 18 * information: Portions Copyright [yyyy] [name of copyright owner] 19 * 20 * CDDL HEADER END 21 */ 22/* | 1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License, Version 1.0 only 6 * (the "License"). You may not use this file except in compliance 7 * with the License. 8 * --- 6 unchanged lines hidden (view full) --- 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16 * If applicable, add the following below this CDDL HEADER, with the 17 * fields enclosed by brackets "[]" replaced with your own identifying 18 * information: Portions Copyright [yyyy] [name of copyright owner] 19 * 20 * CDDL HEADER END 21 */ 22/* |
23 * Copyright 1998 Sun Microsystems, Inc. All rights reserved. | 23 * Copyright 2005 Sun Microsystems, Inc. All rights reserved. |
24 * Use is subject to license terms. 25 */ 26 27/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ 28/* All Rights Reserved */ 29 30/* 31 * University Copyright- Copyright (c) 1982, 1986, 1988 --- 81 unchanged lines hidden (view full) --- 113 114 return (0); 115} 116 117/* 118 * Form all types of queries. 119 * Returns the size of the result or -1. 120 */ | 24 * Use is subject to license terms. 25 */ 26 27/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ 28/* All Rights Reserved */ 29 30/* 31 * University Copyright- Copyright (c) 1982, 1986, 1988 --- 81 unchanged lines hidden (view full) --- 113 114 return (0); 115} 116 117/* 118 * Form all types of queries. 119 * Returns the size of the result or -1. 120 */ |
121int |
|
121res_mkquery(op, dname, class, type, data, datalen, newrr, buf, buflen) 122 int op; /* opcode of query */ 123 char *dname; /* domain name */ 124 int class, type; /* class and type of query */ 125 char *data; /* resource record data */ 126 int datalen; /* length of data */ 127 struct rrec *newrr; /* new rr for modify or append */ 128 char *buf; /* buffer to put query */ 129 int buflen; /* size of buffer */ 130{ 131 register HEADER *hp; 132 register char *cp; 133 register int n; 134 char *dnptrs[10], **dpp, **lastdnptr; 135 136#ifdef DEBUG 137 if (_res.options & RES_DEBUG) 138 printf("res_mkquery(%d, %s, %d, %d)\n", op, dname, class, type); | 122res_mkquery(op, dname, class, type, data, datalen, newrr, buf, buflen) 123 int op; /* opcode of query */ 124 char *dname; /* domain name */ 125 int class, type; /* class and type of query */ 126 char *data; /* resource record data */ 127 int datalen; /* length of data */ 128 struct rrec *newrr; /* new rr for modify or append */ 129 char *buf; /* buffer to put query */ 130 int buflen; /* size of buffer */ 131{ 132 register HEADER *hp; 133 register char *cp; 134 register int n; 135 char *dnptrs[10], **dpp, **lastdnptr; 136 137#ifdef DEBUG 138 if (_res.options & RES_DEBUG) 139 printf("res_mkquery(%d, %s, %d, %d)\n", op, dname, class, type); |
139#endif DEBUG | 140#endif /* DEBUG */ |
140 141 /* 142 * Check to see if we can bailout quickly. 143 * Also rerun res_init if we failed in the past. 144 */ 145 146 if ((_res.options & RES_INIT) == 0 && res_init() == -1) { 147 h_errno = NO_RECOVERY; --- 151 unchanged lines hidden (view full) --- 299#else 300 bcopy(newrr->r_data, cp, newrr->r_size); 301#endif 302 cp += newrr->r_size; 303 } 304 hp->ancount = htons(0); 305 break; 306 | 141 142 /* 143 * Check to see if we can bailout quickly. 144 * Also rerun res_init if we failed in the past. 145 */ 146 147 if ((_res.options & RES_INIT) == 0 && res_init() == -1) { 148 h_errno = NO_RECOVERY; --- 151 unchanged lines hidden (view full) --- 300#else 301 bcopy(newrr->r_data, cp, newrr->r_size); 302#endif 303 cp += newrr->r_size; 304 } 305 hp->ancount = htons(0); 306 break; 307 |
307#endif ALLOW_UPDATES | 308#endif /* ALLOW_UPDATES */ |
308 } 309 return (cp - buf); 310} | 309 } 310 return (cp - buf); 311} |