usr/src/cmd/radpipe/radpipe.c
changeset 798 a7deccd6492f
parent 646 e1e91f5b0cb1
child 834 1e5c5d230679
equal deleted inserted replaced
797:a33daeba9b4c 798:a7deccd6492f
    18  *
    18  *
    19  * CDDL HEADER END
    19  * CDDL HEADER END
    20  */
    20  */
    21 
    21 
    22 /*
    22 /*
    23  * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
    23  * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
    24  */
    24  */
    25 
    25 
    26 #include <sys/types.h>
    26 #include <sys/types.h>
    27 #include <sys/socket.h>
    27 #include <sys/socket.h>
    28 #include <unistd.h>
    28 #include <unistd.h>
    30 #include <errno.h>
    30 #include <errno.h>
    31 #include <string.h>
    31 #include <string.h>
    32 #include <stdlib.h>
    32 #include <stdlib.h>
    33 #include <pthread.h>
    33 #include <pthread.h>
    34 #include <stdio.h>
    34 #include <stdio.h>
       
    35 
       
    36 #include <rad/rad_modapi.h>
    35 
    37 
    36 /*
    38 /*
    37  * Connects to an AF_UNIX socket
    39  * Connects to an AF_UNIX socket
    38  */
    40  */
    39 static int
    41 static int
    99 /* ARGSUSED */
   101 /* ARGSUSED */
   100 int
   102 int
   101 main(int argc, char **argv)
   103 main(int argc, char **argv)
   102 {
   104 {
   103 	if (argc > 1 && strcmp(argv[1], "-u") == 0)
   105 	if (argc > 1 && strcmp(argv[1], "-u") == 0)
   104 		radfd = afunix_connect("/var/run/radsocket-unauth");
   106 		radfd = afunix_connect(RAD_PATH_AFUNIX_UNAUTH);
   105 	else {
   107 	else {
   106 		radfd = afunix_connect("/var/run/radsocket");
   108 		radfd = afunix_connect(RAD_PATH_AFUNIX_AUTH);
   107 	}
   109 	}
   108 
   110 
   109 	if (radfd == -1) {
   111 	if (radfd == -1) {
   110 		perror("unable to connect to rad");
   112 		perror("unable to connect to rad");
   111 		return (1);
   113 		return (1);