home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.protocols.tcp-ip      TCP and IP network protocols.      14,669 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 13,869 of 14,669   
   Ersek, Laszlo to Rick Jones   
   Re: Any stacks out there willing to tell   
   31 Jul 12 23:17:09   
   
   From: lacos@caesar.elte.hu   
      
   On Tue, 31 Jul 2012, Rick Jones wrote:   
      
   > netstat   
      
   > know if there is data queued to the connection but not yet sent.   
      
   On Linux, the netstat utility in net-tools-1.60 seems to parse   
   /proc/net/tcp. See "netstat.c", function tcp_do_one(). Using the   
   "local_address" and "rem_address" column you could find the connection you   
   care about, and then check the "tx_queue" field (first half of the fifth   
   column). There's also a "retrnsmt" column.   
      
   ... The kernel in Debian Squeeze seems to format the "tx_queue" value in   
   this pseudo-file in get_tcp4_sock() [net/ipv4/tcp_ipv4.c] from   
   "tp->write_seq - tp->snd_una".   
      
   ... I started searching for "tp->snd_una" in do_tcp_getsockopt()   
   [net/ipv4/tcp.c] because I was curious if the same value is somehow passed   
   back for TCP_INFO. That was when I finally found the ioctl() whose   
   existence I was completely sure about, just couldn't recall precisely:   
   SIOCOUTQ in tcp_ioctl() [net/ipv4/tcp.c].   
      
   For userspace it's declared in  and it seems to evaluate   
   the same expression (tp->write_seq - tp->snd_una).   
      
   ... It's even documented in "man 7 tcp". Quite a detour I made!   
      
   http://man7.org/linux/man-pages/man7/tcp.7.html   
      
   Laszlo   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca