sbin/atm/atm/atm_subr.c
void
check_netif_name(char *nif)
{
	int	rc;

	/*
	 * Look up the name in the kernel
	 */
	rc = verify_nif_name(nif);

	/*
	 * Check the result
	 */
	if (rc > 0) {
		/*
		 * Name is OK
		 */
		return;
	} else if (rc == 0) {
		/*
		 * Name is not valid
		 */
		fprintf(stderr, "%s: Invalid network interface name %s\n",
				prog, nif);
	} else {
		/*
		 * Error performing IOCTL
		 */
		fprintf(stderr, "%s: ", prog);
		switch(errno) {
		case ENOPROTOOPT:
		case EOPNOTSUPP:
			perror("Internal error");
			break;
		case ENXIO:
			fprintf(stderr, "%s is not an ATM device\n",
					nif);
			break;
		default:
			perror("ioctl (AIOCINFO)");
			break;
		}
	}

	exit(1);
}
/*
 * Make sure a user-supplied parameter is a valid network interface
 * name
 *
 * When a socket call fails, print an error message and exit
 * 
 * Arguments:
 *	nif	pointer to network interface name
 *
 * Returns:
 *	none	exits if name is not valid
 *
 */
Make sure a user-supplied parameter is a valid network interface
name

When a socket call fails, print an error message and exit

nif     pointer to network interface name

none    exits if name is not valid
Make sure a user - supplied parameter is a valid network interface name When a socket call fails print an error message and exit nif pointer to network interface name none exits if name is not valid
void
check_netif_name(char *nif)
{
	int	rc;
	rc = verify_nif_name(nif);
	if (rc > 0) {
		return;
	} else if (rc == 0) {
		fprintf(stderr, "%s: Invalid network interface name %s\n",
				prog, nif);
	} else {
		fprintf(stderr, "%s: ", prog);
		switch(errno) {
		case ENOPROTOOPT:
		case EOPNOTSUPP:
			perror("Internal error");
			break;
		case ENXIO:
			fprintf(stderr, "%s is not an ATM device\n",
					nif);
			break;
		default:
			perror("ioctl (AIOCINFO)");
			break;
		}
	}
	exit(1);
}
void check_netif_name ( char * nif ) { int rc ; rc = verify_nif_name ( nif ) ; if ( rc > 0 ) { return ; } else if ( rc == 0 ) { fprintf ( stderr , " \n " , prog , nif ) ; } else { fprintf ( stderr , " " , prog ) ; switch ( errno ) { case ENOPROTOOPT : case EOPNOTSUPP : perror ( " " ) ; break ; case ENXIO : fprintf ( stderr , " \n " , nif ) ; break ; default : perror ( " " ) ; break ; } } exit ( 1 ) ; }
Make sure a user-supplied parameter is a valid network interface
 name
Make sure a user - supplied parameter is a valid network interface name
/*
	 * Look up the name in the kernel
	 */ /*
	 * Check the result
	 */ /*
		 * Name is OK
		 */ /*
		 * Name is not valid
		 */ /*
		 * Error performing IOCTL
		 */