/* * Report socket allocation statistics [[email protected]] */ int afinet_get_info(char *buffer, char **start, off_t offset, int length) { /* From net/socket.c */ extern int socket_get_info(char *, char **, off_t, int); int len = socket_get_info(buffer,start,offset,length); len += sprintf(buffer+len,"TCP: inuse %d orphan %d tw %d alloc %d mem %d\n", fold_prot_inuse(&tcp_prot), atomic_read(&tcp_orphan_count), tcp_tw_count, atomic_read(&tcp_sockets_allocated), atomic_read(&tcp_memory_allocated)); len += sprintf(buffer+len,"UDP: inuse %d\n", fold_prot_inuse(&udp_prot)); len += sprintf(buffer+len,"RAW: inuse %d\n", fold_prot_inuse(&raw_prot)); len += sprintf(buffer+len, "FRAG: inuse %d memory %d\n", ip_frag_nqueues, atomic_read(&ip_frag_mem)); if (offset >= len) { *start = buffer; return 0; } *start = buffer + offset; len -= offset; if (len > length) len = length; if (len < 0) len = 0; return len; }
/* * Report socket allocation statistics [[email protected]] */ int afinet_get_info(char *buffer, char **start, off_t offset, int length, int dummy) { /* From net/socket.c */ extern int socket_get_info(char *, char **, off_t, int); int len = socket_get_info(buffer,start,offset,length); len += sprintf(buffer+len,"TCP: inuse %d highest %d\n", tcp_prot.inuse, tcp_prot.highestinuse); len += sprintf(buffer+len,"UDP: inuse %d highest %d\n", udp_prot.inuse, udp_prot.highestinuse); len += sprintf(buffer+len,"RAW: inuse %d highest %d\n", raw_prot.inuse, raw_prot.highestinuse); if (offset >= len) { *start = buffer; return 0; } *start = buffer + offset; len -= offset; if (len > length) len = length; if (len < 0) len = 0; return len; }