ypset.c (90297) | ypset.c (90298) |
---|---|
1/* 2 * Copyright (c) 1992/3 Theo de Raadt <deraadt@fsa.ca> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 15 unchanged lines hidden (view full) --- 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 */ 29 30#ifndef lint 31static const char rcsid[] = | 1/* 2 * Copyright (c) 1992/3 Theo de Raadt <deraadt@fsa.ca> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 15 unchanged lines hidden (view full) --- 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 */ 29 30#ifndef lint 31static const char rcsid[] = |
32 "$FreeBSD: head/usr.sbin/ypset/ypset.c 90297 2002-02-06 13:30:31Z des $"; | 32 "$FreeBSD: head/usr.sbin/ypset/ypset.c 90298 2002-02-06 15:26:07Z des $"; |
33#endif /* not lint */ 34 35#include <err.h> 36#include <netdb.h> 37#include <stdio.h> 38#include <string.h> 39#include <unistd.h> 40#include <sys/param.h> --- 4 unchanged lines hidden (view full) --- 45#include <rpcsvc/yp.h> 46struct dom_binding{}; 47#include <rpcsvc/ypclnt.h> 48#include <arpa/inet.h> 49 50extern bool_t xdr_domainname(); 51 52static void | 33#endif /* not lint */ 34 35#include <err.h> 36#include <netdb.h> 37#include <stdio.h> 38#include <string.h> 39#include <unistd.h> 40#include <sys/param.h> --- 4 unchanged lines hidden (view full) --- 45#include <rpcsvc/yp.h> 46struct dom_binding{}; 47#include <rpcsvc/ypclnt.h> 48#include <arpa/inet.h> 49 50extern bool_t xdr_domainname(); 51 52static void |
53usage() | 53usage(void) |
54{ 55 fprintf(stderr, "usage: ypset [-h host] [-d domain] server\n"); 56 exit(1); 57} 58 59int | 54{ 55 fprintf(stderr, "usage: ypset [-h host] [-d domain] server\n"); 56 exit(1); 57} 58 59int |
60bind_tohost(sin, dom, server) 61struct sockaddr_in *sin; 62char *dom, *server; | 60bind_tohost(struct sockaddr_in *sin, char *dom, char *server) |
63{ 64 struct ypbind_setdom ypsd; 65 struct timeval tv; 66 struct hostent *hp; 67 CLIENT *client; 68 int sock, port; 69 int r; 70 unsigned long server_addr; --- 37 unchanged lines hidden (view full) --- 108 clnt_destroy(client); 109 return (YPERR_YPBIND); 110 } 111 clnt_destroy(client); 112 return (0); 113} 114 115int | 61{ 62 struct ypbind_setdom ypsd; 63 struct timeval tv; 64 struct hostent *hp; 65 CLIENT *client; 66 int sock, port; 67 int r; 68 unsigned long server_addr; --- 37 unchanged lines hidden (view full) --- 106 clnt_destroy(client); 107 return (YPERR_YPBIND); 108 } 109 clnt_destroy(client); 110 return (0); 111} 112 113int |
116main(argc, argv) 117char **argv; | 114main(int argc, char *argv[]) |
118{ 119 struct sockaddr_in sin; 120 struct hostent *hent; 121 char *domainname; 122 int c; 123 124 yp_get_default_domain(&domainname); 125 --- 29 unchanged lines hidden --- | 115{ 116 struct sockaddr_in sin; 117 struct hostent *hent; 118 char *domainname; 119 int c; 120 121 yp_get_default_domain(&domainname); 122 --- 29 unchanged lines hidden --- |