Why don't you use the tools for the job.
> > This is from /proc/net/udp:
> > 67: 00000000:0043 00000000:0000 07 00000000:00000000 00:F09045D1 00000000 0 0
> > 111: 00000000:006F 00000000:0000 07 00000000:00000000 00:F09045D1 00000000 0 0
> >
> > Note the shift because of one more digit for the slot. This applies
> > to tcp and raw as well.
>
> This is why _all_ numbers in /proc should be 0-padded hex.
This is why you should run netstat and user tools.
Alan