usr.sbin/atm/atmarpd/atmarp_config.c
int
atmarp_cfg_netif(char *netif)
{
	int			rc;
	Atmarp_intf		*aip = NULL;

	/*
	 * Get an ATMARP interface block
	 */
	aip = (Atmarp_intf *)UM_ALLOC(sizeof(Atmarp_intf));
	if (!aip)
		atmarp_mem_err("atmarp_cfg_netif: sizeof(Atmarp_intf)");
	UM_ZERO(aip, sizeof(Atmarp_intf));

	/*
	 * Make sure we're configuring a valid
	 * network interface
	 */
	rc = verify_nif_name(netif);
	if (rc == 0) {
		fprintf(stderr, "%s: \"%s\" is not a valid network interface\n",
				prog, netif);
		rc = EINVAL;
		goto cfg_fail;
	} else if (rc < 0) {
		rc = errno;
		fprintf(stderr, "%s: can't verify network interface \"%s\"\n",
				prog, netif);
		goto cfg_fail;
	}

	/*
	 * Update the interface entry
	 */
	strcpy(aip->ai_intf, netif);
	aip->ai_state = AI_STATE_NULL;
	aip->ai_scsp_sock = -1;
	LINK2TAIL(aip, Atmarp_intf, atmarp_intf_head, ai_next);

	return(0);

cfg_fail:
	if (aip)
		UM_FREE(aip);

	return(rc);
}
/*
 * Configure network interface for ATMARP cache synchronization
 *
 * Verify the network interface name and set the appropriate fields
 * in the ATMARP interface entry.
 *
 * Arguments:
 *	netif	pointer to network interface name
 *
 * Returns:
 *	0	success
 *	errno	reason for failure
 *
 */
Configure network interface for ATMARP cache synchronization
Verify the network interface name and set the appropriate fields
in the ATMARP interface entry.

netif   pointer to network interface name

0       success
errno   reason for failure
Configure network interface for ATMARP cache synchronization Verify the network interface name and set the appropriate fields in the ATMARP interface entry . netif pointer to network interface name 0 success errno reason for failure
int
atmarp_cfg_netif(char *netif)
{
	int			rc;
	Atmarp_intf		*aip = NULL;
	aip = (Atmarp_intf *)UM_ALLOC(sizeof(Atmarp_intf));
	if (!aip)
		atmarp_mem_err("atmarp_cfg_netif: sizeof(Atmarp_intf)");
	UM_ZERO(aip, sizeof(Atmarp_intf));
	rc = verify_nif_name(netif);
	if (rc == 0) {
		fprintf(stderr, "%s: \"%s\" is not a valid network interface\n",
				prog, netif);
		rc = EINVAL;
		goto cfg_fail;
	} else if (rc < 0) {
		rc = errno;
		fprintf(stderr, "%s: can't verify network interface \"%s\"\n",
				prog, netif);
		goto cfg_fail;
	}
	strcpy(aip->ai_intf, netif);
	aip->ai_state = AI_STATE_NULL;
	aip->ai_scsp_sock = -1;
	LINK2TAIL(aip, Atmarp_intf, atmarp_intf_head, ai_next);
	return(0);
cfg_fail:
	if (aip)
		UM_FREE(aip);
	return(rc);
}
int atmarp_cfg_netif ( char * netif ) { int rc ; Atmarp_intf * aip = NULL ; aip = ( Atmarp_intf * ) UM_ALLOC ( sizeof ( Atmarp_intf ) ) ; if ( ! aip ) atmarp_mem_err ( " " ) ; UM_ZERO ( aip , sizeof ( Atmarp_intf ) ) ; rc = verify_nif_name ( netif ) ; if ( rc == 0 ) { fprintf ( stderr , " \" \" \n " , prog , netif ) ; rc = EINVAL ; goto cfg_fail ; } else if ( rc < 0 ) { rc = errno ; fprintf ( stderr , " \" \" \n " , prog , netif ) ; goto cfg_fail ; } strcpy ( aip -> ai_intf , netif ) ; aip -> ai_state = AI_STATE_NULL ; aip -> ai_scsp_sock = -1 ; LINK2TAIL ( aip , Atmarp_intf , atmarp_intf_head , ai_next ) ; return ( 0 ) ; cfg_fail : if ( aip ) UM_FREE ( aip ) ; return ( rc ) ; }
Configure network interface for ATMARP cache synchronization
 Verify the network interface name and set the appropriate fields
 in the ATMARP interface entry.
Configure network interface for ATMARP cache synchronization Verify the network interface name and set the appropriate fields in the ATMARP interface entry .
/*
	 * Get an ATMARP interface block
	 */ /*
	 * Make sure we're configuring a valid
	 * network interface
	 */ /*
	 * Update the interface entry
	 */