--- airt/sock_hunter.c 2005-01-08 15:04:12.000000000 +1100 +++ airt-new/sock_hunter.c 2005-07-19 10:44:27.000000000 +1000 @@ -157,7 +157,9 @@ case 10: return "TCP_LISTEN"; - //TCP_CLOSING; + + case 11: + return "TCP_CLOSING"; default: return "unknow state"; @@ -219,7 +221,7 @@ struct list_head *p, *q; struct kmem_cache_s *cachep; struct slab *slabp; - struct tcp_sock *tcp_sk; + struct inet_sock tcp_sk_inet; int i; @@ -249,9 +251,9 @@ list_for_each(q, &(cachep->lists.slabs_full)){ slabp = list_entry(q, struct slab, list); for(i = 0; i < cachep->num; i++){ - tcp_sk = slabp->s_mem + i * cachep->objsize; - // printk("port:%d, ip:%x, state:%d\n", tcp_sk->inet.sport, tcp_sk->inet.saddr, tcp_sk->sk.sk_state); - printk("%5d %15s %15s\n", ntohs(tcp_sk->inet.sport), in_ntoa(tcp_sk->inet.saddr), parse_tcp_state(tcp_sk->sk.sk_state)); + tcp_sk_inet = ((struct tcp_sock *) slabp->s_mem + i * cachep->objsize)->inet; + // printk("port:%d, ip:%x, state:%d\n", tcp_sk_inet.sport, tcp_sk_inet.saddr, tcp_sk_inet.sk.sk_state); + printk("%5d %15s %15s\n", ntohs(tcp_sk_inet.sport), in_ntoa(tcp_sk_inet.saddr), parse_tcp_state(tcp_sk_inet.sk.sk_state)); } } /*---------- slabs partial --------------*/ @@ -269,9 +271,9 @@ for(i = 0; i < cachep->num; i++){ if(!my_array[i]){ - tcp_sk = slabp->s_mem + i * cachep->objsize; - // printk("port-s:%d, ip:%x, state:%d\n", ntohs(tcp_sk->inet.sport), tcp_sk->inet.saddr, tcp_sk->sk.sk_state); - printk("%5d %15s %15s\n", ntohs(tcp_sk->inet.sport), in_ntoa(tcp_sk->inet.saddr), parse_tcp_state(tcp_sk->sk.sk_state)); + tcp_sk_inet = ((struct tcp_sock *)slabp->s_mem + i * cachep->objsize)->inet; + // printk("port-s:%d, ip:%x, state:%d\n", ntohs(tcp_sk_inet.sport), tcp_sk_inet.saddr, tcp_sk_inet.sk.sk_state); + printk("%5d %15s %15s\n", ntohs(tcp_sk_inet.sport), in_ntoa(tcp_sk_inet.saddr), parse_tcp_state(tcp_sk_inet.sk.sk_state)); } } } @@ -285,9 +287,9 @@ list_for_each(q, &(cachep->lists.slabs_full)){ slabp = list_entry(q, struct slab, list); for(i = 0; i < cachep->num; i++){ - tcp_sk = slabp->s_mem + i * cachep->objsize; - // printk("port:%d, ip:%x, state:%d\n", tcp_sk->inet.sport, tcp_sk->inet.saddr, tcp_sk->sk.sk_state); - printk("%5d %15s %15s\n", ntohs(tcp_sk->inet.sport), in_ntoa(tcp_sk->inet.saddr), parse_tcp_state(tcp_sk->sk.sk_state)); + tcp_sk_inet = ((struct tcp_sock *) slabp->s_mem + i * cachep->objsize)->inet; + // printk("port:%d, ip:%x, state:%d\n", tcp_sk_inet.sport, tcp_sk_inet.saddr, tcp_sk_inet.sk.sk_state); + printk("%5d %15s %15s\n", ntohs(tcp_sk_inet.sport), in_ntoa(tcp_sk_inet.saddr), parse_tcp_state(tcp_sk_inet.sk.sk_state)); } } /*---------- slabs partial --------------*/ @@ -305,9 +307,9 @@ for(i = 0; i < cachep->num; i++){ if(!my_array[i]){ - tcp_sk = slabp->s_mem + i * cachep->objsize; - // printk("port-s:%d, ip:%x, state:%d\n", ntohs(tcp_sk->inet.sport), tcp_sk->inet.saddr, tcp_sk->sk.sk_state); - printk("%5d %15s %15s\n", ntohs(tcp_sk->inet.sport), in_ntoa(tcp_sk->inet.saddr), parse_tcp_state(tcp_sk->sk.sk_state)); + tcp_sk_inet = ((struct tcp_sock *) slabp->s_mem + i * cachep->objsize)->inet; + // printk("port-s:%d, ip:%x, state:%d\n", ntohs(tcp_sk_inet.sport), tcp_sk_inet.saddr, tcp_sk_inet.sk.sk_state); + printk("%5d %15s %15s\n", ntohs(tcp_sk_inet.sport), in_ntoa(tcp_sk_inet.saddr), parse_tcp_state(tcp_sk_inet.sk.sk_state)); } } } @@ -321,9 +323,9 @@ list_for_each(q, &(cachep->lists.slabs_full)){ slabp = list_entry(q, struct slab, list); for(i = 0; i < cachep->num; i++){ - tcp_sk = slabp->s_mem + i * cachep->objsize; - // printk("port:%d, ip:%x, state:%d\n", tcp_sk->inet.sport, tcp_sk->inet.saddr, tcp_sk->sk.sk_state); - printk("%5d %15s %15s %15s\n", ntohs(tcp_sk->inet.sport), in_ntoa(tcp_sk->inet.saddr), in_ntoa(tcp_sk->inet.daddr), parse_raw_state(tcp_sk->sk.sk_state)); + tcp_sk_inet = ((struct tcp_sock *) slabp->s_mem + i * cachep->objsize)->inet; + // printk("port:%d, ip:%x, state:%d\n", tcp_sk_inet.sport, tcp_sk_inet.saddr, tcp_sk_inet.sk.sk_state); + printk("%5d %15s %15s %15s\n", ntohs(tcp_sk_inet.sport), in_ntoa(tcp_sk_inet.saddr), in_ntoa(tcp_sk_inet.daddr), parse_raw_state(tcp_sk_inet.sk.sk_state)); } } /*---------- slabs partial --------------*/ @@ -341,9 +343,9 @@ for(i = 0; i < cachep->num; i++){ if(!my_array[i]){ - tcp_sk = slabp->s_mem + i * cachep->objsize; - // printk("%5d %15s %15s\n", ntohs(tcp_sk->inet.sport), in_ntoa(tcp_sk->inet.saddr), parse_raw_state(tcp_sk->sk.sk_state)); - printk("%5d %15s %15s %15s\n", ntohs(tcp_sk->inet.sport), in_ntoa(tcp_sk->inet.saddr), in_ntoa(tcp_sk->inet.daddr), parse_raw_state(tcp_sk->sk.sk_state)); + tcp_sk_inet = ((struct tcp_sock *) slabp->s_mem + i * cachep->objsize)->inet; + // printk("%5d %15s %15s\n", ntohs(tcp_sk_inet.sport), in_ntoa(tcp_sk_inet.saddr), parse_raw_state(tcp_sk_inet.sk.sk_state)); + printk("%5d %15s %15s %15s\n", ntohs(tcp_sk_inet.sport), in_ntoa(tcp_sk_inet.saddr), in_ntoa(tcp_sk_inet.daddr), parse_raw_state(tcp_sk_inet.sk.sk_state)); } } } --- airt/mod_hunter.c 2005-01-08 15:04:18.000000000 +1100 +++ airt-new/mod_hunter.c 2005-07-19 10:21:47.000000000 +1000 @@ -299,8 +299,8 @@ } #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,7) -printk("kobj refcount: %ud\n", ((struct module *)evil_addr)->mkobj->kobj.kref.refcount.counter); - if (kobject_register(&((struct module *)evil_addr)->mkobj->kobj)) +printk("kobj refcount: %ud\n", ((struct module *)evil_addr)->mkobj.kobj.kref.refcount.counter); + if (kobject_register(&((struct module *)evil_addr)->mkobj.kobj)) { printk("kobject already registered or registered failed\n"); return -EFAULT;