- if(count == 0)
- return 0;
- page = get_zeroed_page(GFP_KERNEL);
- if(!page)
- return -ENOMEM;
- atm_mpoa_disp_qos((char *)page, &length);
- while(mpc != NULL){
- length += print_header((char *)page + length, mpc);
- length += sprintf((char *)page + length,"Ingress Entries:\nIP address State Holding time Packets fwded VPI VCI\n");
- in_entry = mpc->in_cache;
- do_gettimeofday(&now);
- while(in_entry != NULL){
- temp = (unsigned char *)&in_entry->ctrl_info.in_dst_ip; sprintf(ip_string,"%d.%d.%d.%d", temp[0], temp[1], temp[2], temp[3]);
- length += sprintf((char *)page + length,"%-16s%s%-14lu%-12u", ip_string, ingress_state_string(in_entry->entry_state), (in_entry->ctrl_info.holding_time-(now.tv_sec-in_entry->tv.tv_sec)), in_entry->packets_fwded);
- if(in_entry->shortcut)
- length += sprintf((char *)page + length," %-3d %-3d",in_entry->shortcut->vpi,in_entry->shortcut->vci);
- length += sprintf((char *)page + length,"\n");
- in_entry = in_entry->next;
- }
- length += sprintf((char *)page + length,"\n");
- eg_entry = mpc->eg_cache;
- length += sprintf((char *)page + length,"Egress Entries:\nIngress MPC ATM addr\nCache-id State Holding time Packets recvd Latest IP addr VPI VCI\n");
- while(eg_entry != NULL){
- for(i=0;i<ATM_ESA_LEN;i++){
- length += sprintf((char *)page + length,"%02x",eg_entry->ctrl_info.in_MPC_data_ATM_addr[i]);}
- length += sprintf((char *)page + length,"\n%-16lu%s%-14lu%-15u",(unsigned long) ntohl(eg_entry->ctrl_info.cache_id), egress_state_string(eg_entry->entry_state), (eg_entry->ctrl_info.holding_time-(now.tv_sec-eg_entry->tv.tv_sec)), eg_entry->packets_rcvd);
-
- /* latest IP address */
- temp = (unsigned char *)&eg_entry->latest_ip_addr;
- sprintf(ip_string, "%d.%d.%d.%d", temp[0], temp[1], temp[2], temp[3]);
- length += sprintf((char *)page + length, "%-16s", ip_string);
-
- if(eg_entry->shortcut)
- length += sprintf((char *)page + length," %-3d %-3d",eg_entry->shortcut->vpi,eg_entry->shortcut->vci);
- length += sprintf((char *)page + length,"\n");
- eg_entry = eg_entry->next;
- }
- length += sprintf((char *)page + length,"\n");
- mpc = mpc->next;