FreeBSD/sbin/atm/atmconfig/diag.c
/*
 * Print the VCC table for this interface.
 */
Print the VCC table for this interface.
Print the VCC table for this interface .
static void
print_channel(const struct diagif *aif)
{
	const struct atmio_vcc *v;
	static const char *const aal_tab[] = {
		[ATMIO_AAL_0] = "0",
		[ATMIO_AAL_34] = "3/4",
		[ATMIO_AAL_5] = "5",
		[ATMIO_AAL_RAW] = "raw",
	};
	static const char *const traffic_tab[] = {
		[ATMIO_TRAFFIC_UBR] = "ubr",
		[ATMIO_TRAFFIC_CBR] = "cbr",
		[ATMIO_TRAFFIC_ABR] = "abr",
		[ATMIO_TRAFFIC_VBR] = "vbr",
	};
	for (v = aif->vtab->vccs; v < &aif->vtab->vccs[aif->vtab->count]; v++) {
		printf("%-6u%-9s%-4u%-6u", aif->index, aif->ifname,
		    v->vpi, v->vci);
		if (v->aal >= sizeof(aal_tab)/sizeof(aal_tab[0]) ||
		    aal_tab[v->aal] == NULL)
			printf("bad ");
		else
			printf("%-4s", aal_tab[v->aal]);
		if (v->traffic >= sizeof(traffic_tab)/sizeof(traffic_tab[0]) ||
		    traffic_tab[v->traffic] == NULL)
			printf("bad     ");
		else
			printf("%-8s", traffic_tab[v->traffic]);
		printf("%-6u%-6u%s\n", v->rmtu, v->tmtu,
		    printb(v->flags, ATMIO_FLAGS));
	}
}
static void print_channel ( const struct diagif * aif ) { const struct atmio_vcc * v ; static const char * const aal_tab [ ] = { [ ATMIO_AAL_0 ] = " " , [ ATMIO_AAL_34 ] = " " , [ ATMIO_AAL_5 ] = " " , [ ATMIO_AAL_RAW ] = " " , } ; static const char * const traffic_tab [ ] = { [ ATMIO_TRAFFIC_UBR ] = " " , [ ATMIO_TRAFFIC_CBR ] = " " , [ ATMIO_TRAFFIC_ABR ] = " " , [ ATMIO_TRAFFIC_VBR ] = " " , } ; for ( v = aif -> vtab -> vccs ; v < & aif -> vtab -> vccs [ aif -> vtab -> count ] ; v ++ ) { printf ( " " , aif -> index , aif -> ifname , v -> vpi , v -> vci ) ; if ( v -> aal >= sizeof ( aal_tab ) / sizeof ( aal_tab [ 0 ] ) || aal_tab [ v -> aal ] == NULL ) printf ( " " ) ; else printf ( " " , aal_tab [ v -> aal ] ) ; if ( v -> traffic >= sizeof ( traffic_tab ) / sizeof ( traffic_tab [ 0 ] ) || traffic_tab [ v -> traffic ] == NULL ) printf ( " " ) ; else printf ( " " , traffic_tab [ v -> traffic ] ) ; printf ( " \n " , v -> rmtu , v -> tmtu , printb ( v -> flags , ATMIO_FLAGS ) ) ; } }
Print the VCC table for this interface.
Print the VCC table for this interface .