public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] SNMP data available in 1.0b1 stack?
@ 2000-12-06  9:20 Grant Edwards
  2000-12-06  9:45 ` Hugo Tyson
  0 siblings, 1 reply; 10+ messages in thread
From: Grant Edwards @ 2000-12-06  9:20 UTC (permalink / raw)
  To: ecos-discuss

I've read somewhere that the current version of the TCP/IP
stack includes optional SNMP support.  While I do not currently
need to support SNMP, I do need to provide a significant subset
of the same data via a web page.

Is that data tucked away somewhere in the 1.0b1 stack, or will
I need to update to a newer version of the stack?

-- 
Grant Edwards
grante@visi.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [ECOS] SNMP data available in 1.0b1 stack?
  2000-12-06  9:20 [ECOS] SNMP data available in 1.0b1 stack? Grant Edwards
@ 2000-12-06  9:45 ` Hugo Tyson
  2000-12-06 10:05   ` Grant Edwards
       [not found]   ` <3A2E93C9.BCFEE121@cygnus.co.uk>
  0 siblings, 2 replies; 10+ messages in thread
From: Hugo Tyson @ 2000-12-06  9:45 UTC (permalink / raw)
  To: ecos-discuss


Grant Edwards <grante@visi.com> writes:
> I've read somewhere that the current version of the TCP/IP
> stack includes optional SNMP support.  While I do not currently
> need to support SNMP, I do need to provide a significant subset
> of the same data via a web page.
> 
> Is that data tucked away somewhere in the 1.0b1 stack, or will
> I need to update to a newer version of the stack?

I would go with whatever is the latest - Jifl?  What's anoncvs status?

For clarification about SNMP, the SNMP agent and library packages are
distributed in a separate EPK, that you add to the repository along with
the net+logical ether driver EPK.

The data is indeed tucked away somewhere in the network stack, in fact the
OpenBSD sources are already "SNMP friendly" to coin a phrase, in that the
various protocol or layer handlers support statistics structures that are
just what you want.  For example, from the TCP MIB support code as
collected straight from UCD, if I remember correctly:

    case TCPACTIVEOPENS:
        long_ret = tcpstat.tcps_connattempt;
        return (unsigned char *) &long_ret;

    case TCPPASSIVEOPENS:
        long_ret = tcpstat.tcps_accepts;
        return (unsigned char *) &long_ret;

    case TCPATTEMPTFAILS:
        long_ret = tcpstat.tcps_conndrops;
        return (unsigned char *) &long_ret;

    case TCPESTABRESETS:
        long_ret = tcpstat.tcps_drops;
        return (unsigned char *) &long_ret;

So you should be able to just pull out these stats in any app linked with
the net stack.  (This code is compiled with _KERNEL defined to cause the
network headers to expose these in-kernel data structures)

So you should be able to find these kinds of structs in your network
headers somewhere...  ah yes, a quick few greps reveal these:

./include/net/if_pppvar.h:      struct  pppstat sc_stats;
./include/netinet/icmp_var.h:struct     icmpstat {
./include/netinet/icmp_var.h:struct     icmpstat icmpstat;
./include/netinet/igmp_var.h:struct igmpstat {
./include/netinet/igmp_var.h:struct igmpstat igmpstat;
./include/netinet/ip_var.h:struct       ipstat {
./include/netinet/ip_var.h:struct         ipstat ipstat;
./include/netinet/tcp_var.h:struct      tcpstat {
./include/netinet/tcp_var.h:struct      tcpstat tcpstat;
./include/netinet/udp_var.h:struct      udpstat {
./include/netinet/udp_var.h:struct      udpstat udpstat;

HTH,
	- Huge

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [ECOS] SNMP data available in 1.0b1 stack?
  2000-12-06  9:45 ` Hugo Tyson
@ 2000-12-06 10:05   ` Grant Edwards
       [not found]   ` <3A2E93C9.BCFEE121@cygnus.co.uk>
  1 sibling, 0 replies; 10+ messages in thread
From: Grant Edwards @ 2000-12-06 10:05 UTC (permalink / raw)
  To: Hugo Tyson; +Cc: ecos-discuss

On Wed, Dec 06, 2000 at 05:38:06PM +0000, Hugo Tyson wrote:

> > I've read somewhere that the current version of the TCP/IP
> > stack includes optional SNMP support.  While I do not currently
> > need to support SNMP, I do need to provide a significant subset
> > of the same data via a web page.
> > 
> > Is that data tucked away somewhere in the 1.0b1 stack, or will
> > I need to update to a newer version of the stack?
> 
> I would go with whatever is the latest - Jifl?  What's anoncvs
> status?

That's under consideration.  However, it involves a significant
amount of work.  We're currently shipping product using 1.3.1
and 1.0b1.  If I want to switch to a newer version, I either
have to switch over existing products [requiring a bunch of
rebuilding, testing, ECOs, etc.] or maintain two eCos systems
in parallel.  One of these days I'll probably bite the bullet
and upgrade things, but for now I'm taking the path of least
resistance.

> For clarification about SNMP, the SNMP agent and library
> packages are distributed in a separate EPK, that you add to the
> repository along with the net+logical ether driver EPK.

One of these days I'll need to add that, but right now they're
wanting web-based stuff more than they want SNMP.

> The data is indeed tucked away somewhere in the network stack,
> in fact the OpenBSD sources are already "SNMP friendly" to coin
> a phrase, in that the various protocol or layer handlers
> support statistics structures that are just what you want.

That's the answer I was hoping for!

> For example, from the TCP MIB support code as collected
> straight from UCD, if I remember correctly:
> 
>     case TCPACTIVEOPENS:
>         long_ret = tcpstat.tcps_connattempt;
>         return (unsigned char *) &long_ret;

Cool.  

> ./include/net/if_pppvar.h:      struct  pppstat sc_stats;
> ./include/netinet/icmp_var.h:struct     icmpstat {
> ./include/netinet/icmp_var.h:struct     icmpstat icmpstat;
> ./include/netinet/igmp_var.h:struct igmpstat {
> ./include/netinet/igmp_var.h:struct igmpstat igmpstat;
> ./include/netinet/ip_var.h:struct       ipstat {
> ./include/netinet/ip_var.h:struct         ipstat ipstat;
> ./include/netinet/tcp_var.h:struct      tcpstat {
> ./include/netinet/tcp_var.h:struct      tcpstat tcpstat;
> ./include/netinet/udp_var.h:struct      udpstat {
> ./include/netinet/udp_var.h:struct      udpstat udpstat;

Thanks much!  

That's far more detail than I was expecting in an answer.  I'd
have been happy to figure out where the data were on my own,
but I was hoping somebody could tell they existed before I
started the search.  

You've probably saved me an afternoon's work.  ;)

-- 
Grant Edwards
grante@visi.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [ECOS] SNMP data available in 1.0b1 stack?
       [not found]   ` <3A2E93C9.BCFEE121@cygnus.co.uk>
@ 2000-12-06 12:15     ` Grant Edwards
  2000-12-06 12:28       ` Jonathan Larmour
  0 siblings, 1 reply; 10+ messages in thread
From: Grant Edwards @ 2000-12-06 12:15 UTC (permalink / raw)
  To: Jonathan Larmour; +Cc: Hugo Tyson, ecos-discuss

On Wed, Dec 06, 2000 at 07:30:17PM +0000, Jonathan Larmour wrote:

> > > I've read somewhere that the current version of the TCP/IP
> > > stack includes optional SNMP support.  While I do not currently
> > > need to support SNMP, I do need to provide a significant subset
> > > of the same data via a web page.
> > >
> > > Is that data tucked away somewhere in the 1.0b1 stack, or will
> > > I need to update to a newer version of the stack?
>  
> > So you should be able to just pull out these stats in any app linked with
> > the net stack.  (This code is compiled with _KERNEL defined to cause the
> > network headers to expose these in-kernel data structures)
> 
> But you would need an updated network stack from anoncvs to even have those
> stats I believe? They weren't exported until you did it for SNMP as I
> recall?

It looks like they're there in 1.0b1:

$ grep stat rpshsi2p.map | grep -v static_initialization_and_destruction

tcpstat             0x110             ../ecos-build/install/lib/libtarget.a(net_tcpip_in_proto.o)
mbstat              0x21c             ../ecos-build/install/lib/libtarget.a(net_tcpip_if.o)
ipstat              0x70              ../ecos-build/install/lib/libtarget.a(net_tcpip_igmp.o)
stats_in_cksum      0x10              ../ecos-build/install/lib/libtarget.a(net_tcpip_in_cksum.o)
udpstat             0x2c              ../ecos-build/install/lib/libtarget.a(net_tcpip_in_proto.o)
igmpstat            0x24              ../ecos-build/install/lib/libtarget.a(net_tcpip_igmp.o)
rtstat              0x14              ../ecos-build/install/lib/libtarget.a(net_tcpip_if.o)
icmpstat            0xbc              ../ecos-build/install/lib/libtarget.a(net_tcpip_ip_icmp.o)
                0x000668a0                mbstat
                0x00066b60                rtstat
                0x00066be0                ipstat
                0x00066c50                igmpstat
                0x00066ca0                stats_in_cksum
                0x00066d40                tcpstat
                0x0006d580                udpstat
                0x0006d5f0                icmpstat

The one that's missing is etheripstat, and I presume that's
because my ethernet driver isn't filling in the data and there
are no references to it.

Now that I think about it, don't some of the test programs in
the net 1.0b1 distros print out data from some of these when
they finish?

-- 
Grant Edwards
grante@visi.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [ECOS] SNMP data available in 1.0b1 stack?
  2000-12-06 12:15     ` Grant Edwards
@ 2000-12-06 12:28       ` Jonathan Larmour
  2000-12-06 12:44         ` Grant Edwards
  2000-12-07  2:45         ` Hugo Tyson
  0 siblings, 2 replies; 10+ messages in thread
From: Jonathan Larmour @ 2000-12-06 12:28 UTC (permalink / raw)
  To: Grant Edwards; +Cc: Hugo Tyson, ecos-discuss

Grant Edwards wrote:
> 
> On Wed, Dec 06, 2000 at 07:30:17PM +0000, Jonathan Larmour wrote:
> 
> > But you would need an updated network stack from anoncvs to even have those
> > stats I believe? They weren't exported until you did it for SNMP as I
> > recall?
> 
> It looks like they're there in 1.0b1:
> 
> $ grep stat rpshsi2p.map | grep -v static_initialization_and_destruction
> 
> tcpstat             0x110             ../ecos-build/install/lib/libtarget.a(net_tcpip_in_proto.o)
[snip] 
> The one that's missing is etheripstat, and I presume that's
> because my ethernet driver isn't filling in the data and there
> are no references to it.
> 
> Now that I think about it, don't some of the test programs in
> the net 1.0b1 distros print out data from some of these when
> they finish?

Yes you're right. It's the ethernet driver statistics I was thinking about.
The main stats should be there in the EPK.

Jifl
-- 
Red Hat, 35 Cambridge Place, Cambridge, UK. CB2 1NS  Tel: +44 (1223) 728762
"Plan to be spontaneous tomorrow."  ||  These opinions are all my own fault

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [ECOS] SNMP data available in 1.0b1 stack?
  2000-12-06 12:28       ` Jonathan Larmour
@ 2000-12-06 12:44         ` Grant Edwards
  2000-12-06 12:57           ` Jonathan Larmour
  2000-12-07  2:45         ` Hugo Tyson
  1 sibling, 1 reply; 10+ messages in thread
From: Grant Edwards @ 2000-12-06 12:44 UTC (permalink / raw)
  To: Jonathan Larmour; +Cc: Hugo Tyson, ecos-discuss

On Wed, Dec 06, 2000 at 08:28:47PM +0000, Jonathan Larmour wrote:

> > > But you would need an updated network stack from anoncvs to
> > > even have those stats I believe? They weren't exported until
> > > you did it for SNMP as I recall?
> > 
> > It looks like they're there in 1.0b1:
[...]
> > The one that's missing is etheripstat, and I presume that's
> > because my ethernet driver isn't filling in the data and there
> > are no references to it. 
[...]
> Yes you're right. It's the ethernet driver statistics I was
> thinking about. The main stats should be there in the EPK.

In the newer sources, are the Ethernet stats filled in by the
generic Ethernet layer or by the individual Ethernet hardware
drivers?

For now, I'll probably go with what's in 1.0b1 and have my
Ethernet driver fill in the fields in etheripstat I care about.
There are Ethernet packets that I don't route up through the
eCos stack (they're handled by a second protocol stack that
impliments a homebrew HDCL-over-Ethernet scheme), and I need
include those in the my stats.

-- 
Grant Edwards
grante@visi.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [ECOS] SNMP data available in 1.0b1 stack?
  2000-12-06 12:44         ` Grant Edwards
@ 2000-12-06 12:57           ` Jonathan Larmour
  2000-12-06 13:02             ` Grant Edwards
  0 siblings, 1 reply; 10+ messages in thread
From: Jonathan Larmour @ 2000-12-06 12:57 UTC (permalink / raw)
  To: Grant Edwards; +Cc: Hugo Tyson, ecos-discuss

Grant Edwards wrote:
> 
> On Wed, Dec 06, 2000 at 08:28:47PM +0000, Jonathan Larmour wrote:
> 
> > > > But you would need an updated network stack from anoncvs to
> > > > even have those stats I believe? They weren't exported until
> > > > you did it for SNMP as I recall?
> > >
> > > It looks like they're there in 1.0b1:
> [...]
> > > The one that's missing is etheripstat, and I presume that's
> > > because my ethernet driver isn't filling in the data and there
> > > are no references to it.
> [...]
> > Yes you're right. It's the ethernet driver statistics I was
> > thinking about. The main stats should be there in the EPK.
> 
> In the newer sources, are the Ethernet stats filled in by the
> generic Ethernet layer or by the individual Ethernet hardware
> drivers?

The latter. Perhaps look at anoncvs for comparison purposes, even if you
don't use it.

Jifl
-- 
Red Hat, 35 Cambridge Place, Cambridge, UK. CB2 1NS  Tel: +44 (1223) 728762
"Plan to be spontaneous tomorrow."  ||  These opinions are all my own fault

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [ECOS] SNMP data available in 1.0b1 stack?
  2000-12-06 12:57           ` Jonathan Larmour
@ 2000-12-06 13:02             ` Grant Edwards
  0 siblings, 0 replies; 10+ messages in thread
From: Grant Edwards @ 2000-12-06 13:02 UTC (permalink / raw)
  To: Jonathan Larmour; +Cc: Hugo Tyson, ecos-discuss

On Wed, Dec 06, 2000 at 08:56:56PM +0000, Jonathan Larmour wrote:

> > In the newer sources, are the Ethernet stats filled in by the
> > generic Ethernet layer or by the individual Ethernet hardware
> > drivers?
> 
> The latter. Perhaps look at anoncvs for comparison purposes,
> even if you don't use it.

I'll do that.

Thanks for the help.

-- 
Grant Edwards
grante@visi.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [ECOS] SNMP data available in 1.0b1 stack?
  2000-12-06 12:28       ` Jonathan Larmour
  2000-12-06 12:44         ` Grant Edwards
@ 2000-12-07  2:45         ` Hugo Tyson
  2000-12-07  7:13           ` Grant Edwards
  1 sibling, 1 reply; 10+ messages in thread
From: Hugo Tyson @ 2000-12-07  2:45 UTC (permalink / raw)
  To: ecos-discuss


Jonathan Larmour <jlarmour@cygnus.co.uk> writes:
> Grant Edwards wrote:
> > On Wed, Dec 06, 2000 at 07:30:17PM +0000, Jonathan Larmour wrote:
> > 
> > > But you would need an updated network stack to have those
> > > stats I believe?

(nope)

> > It looks like they're there in 1.0b1:
> [snip] 
> > The one that's missing is etheripstat, and I presume that's
> > because my ethernet driver isn't filling in the data and there
> > are no references to it.

Grepping the current trunk code....
1) etheripstat is not used *anywhere* in our sources at all, not even by
   SNMP.
2) etheripstat seems to be conditional on IPSEC, which we don't define.
3) the comment in netinet/ip_ether.h suggests that it's for
   "Ethernet-inside-IP processing" - is this a type of tunneling?
   Anyway, it's NOT for normal ethernet device stats; 
   specifically, there would have to be one per interface.

> > Now that I think about it, don't some of the test programs in
> > the net 1.0b1 distros print out data from some of these when
> > they finish?
> 
> Yes you're right. It's the ethernet driver statistics I was thinking about.
> The main stats should be there in the EPK.

The ethernet device stats are acquired by an ioctl() in the device driver,
using a new struct that wasn't part of the TCP/IP stack.  Yes, that new
code was written for SNMPs usage.  "io/eth/current/include/eth_drv_stats.h"
defines it, the ioctl numbers are in "io/eth/current/include/eth_drv.h"

It has to be an ioctl() because SNMP wants stats separately for each
device, without knowing the type of device, nor knowing in advance how many
there are.  Including customer devices that I have 0 knowledge of.  So a
single static struct, nor even a static array of structs doesn't cut it.

To summarize: etheripstat is a red herring. ;-)

	- Huge

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [ECOS] SNMP data available in 1.0b1 stack?
  2000-12-07  2:45         ` Hugo Tyson
@ 2000-12-07  7:13           ` Grant Edwards
  0 siblings, 0 replies; 10+ messages in thread
From: Grant Edwards @ 2000-12-07  7:13 UTC (permalink / raw)
  To: Hugo Tyson; +Cc: ecos-discuss

On Thu, Dec 07, 2000 at 10:38:43AM +0000, Hugo Tyson wrote:

> > > It looks like they're there in 1.0b1:
> > [snip] 
> > > The one that's missing is etheripstat, and I presume that's
> > > because my ethernet driver isn't filling in the data and there
> > > are no references to it.
> 
> Grepping the current trunk code....
> 1) etheripstat is not used *anywhere* in our sources at all, not even by
>    SNMP.
> 2) etheripstat seems to be conditional on IPSEC, which we don't define.
> 3) the comment in netinet/ip_ether.h suggests that it's for
>    "Ethernet-inside-IP processing" - is this a type of tunneling?
>    Anyway, it's NOT for normal ethernet device stats; 
>    specifically, there would have to be one per interface.
[...]
> The ethernet device stats are acquired by an ioctl() in the
> device driver, using a new struct that wasn't part of the
> TCP/IP stack.  Yes, that new code was written for SNMPs usage.
> "io/eth/current/include/eth_drv_stats.h" defines it, the ioctl
> numbers are in "io/eth/current/include/eth_drv.h" 
[...]

> To summarize: etheripstat is a red herring. ;-)

Thanks for the correction.  I'll impliment that ioctl in my
Ethernet driver -- then it should be compatible with the
updated stack and SNMP server (someday I probably will need to
add SNMP support, but web-based stats is tres chic at the
moment).

-- 
Grant Edwards
grante@visi.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2000-12-07  7:13 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-12-06  9:20 [ECOS] SNMP data available in 1.0b1 stack? Grant Edwards
2000-12-06  9:45 ` Hugo Tyson
2000-12-06 10:05   ` Grant Edwards
     [not found]   ` <3A2E93C9.BCFEE121@cygnus.co.uk>
2000-12-06 12:15     ` Grant Edwards
2000-12-06 12:28       ` Jonathan Larmour
2000-12-06 12:44         ` Grant Edwards
2000-12-06 12:57           ` Jonathan Larmour
2000-12-06 13:02             ` Grant Edwards
2000-12-07  2:45         ` Hugo Tyson
2000-12-07  7:13           ` Grant Edwards

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).