if (server == NULL) { printf("No server available!\n"); return; }
quip_printconfig(void){	char buf[BODY_MAXSIZE], name[256], *cp, *p, *flname;	int result_code, len;	enum nametype type;	u_long handle;	/* get a total list from the server */	quip_sendrequest(server, "GET list\n");	result_code = quip_recvresponse(server, NULL, buf, &len);	if (result_code != 200)		errx(1, "can't get total list");	printf("------------ current configuration ------------");	cp = buf;	while (1) {		if (sscanf(cp, "%lx %s", &handle, name) != 2)			break;		if ((p = strchr(name, ':')) == NULL)			type = INTERFACE;		else if (strchr(p+1, ':') == NULL)			type = CLASS;		else			type = FILTER;		switch (type) {		case INTERFACE:			printf("\ninterface: %s  (index:%lu)\n",			       name, handle);			quip_printqdisc(name);			break;		case CLASS:			printf("class: %s  (handle:%#lx)\n",			       name, handle);			break;		case FILTER:			flname = strrchr(name, ':') + 1;			printf("  filter: name:%s [", flname);			quip_printfilter(extract_ifname(name), handle);			printf("]  (handle:%#lx)\n", handle);			break;		case CONDITIONER:			break;		}		if ((cp = strchr(cp+1, '\n')) == NULL)			break;	}	printf("-----------------------------------------------\n\n");}