public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: "Trenton D. Adams" <tadams@theone.dnsalias.com>
To: "'eCos Discussion'" <ecos-discuss@sourceware.cygnus.com>
Subject: [ECOS] making netstat () diagnostic function
Date: Thu, 23 Aug 2001 15:31:00 -0000	[thread overview]
Message-ID: <000701c12c23$5e4c49e0$090110ac@TRENT> (raw)

I want to make a netstat () diagnostic function.  That is if it's not
going to take to long.  If it does, I'll drop it.  I can't imagine it
taking very long if I can find out all the structure information I need.

From what I understand, there's a global "fds" variable right?  This
holds file descriptors including sockets right?

I assume that these defines below are the file descriptor types for the
"f_type" field in the "file" structure?

Info below is from io/common/current/include/file.h
// Type of "file"
#define	DTYPE_VNODE	1	/* file */
#define	DTYPE_SOCKET	2	/* communications endpoint */
#define	DTYPE_PIPE	3	/* pipe */

struct file {
    short	f_flag;		/* file state */
    short	f_type;		/* descriptor type */
    struct	fileops {
        int	(*fo_read)(struct file *fp, struct uio *uio);
        int	(*fo_write)(struct file *fp, struct uio *uio);
        int	(*fo_ioctl)(struct file *fp, CYG_ADDRWORD com,
                            CYG_ADDRWORD data);
        int	(*fo_select)(struct file *fp, int which);
        int	(*fo_close)(struct file *fp);
    } *f_ops;
    CYG_ADDRWORD	f_offset;
    CYG_ADDRWORD	f_data;		/* vnode or socket */
};


Where would I find what "f_data" is pointing to in the case of a socket?
I assume it's a structure of some sort that holds all the information
about the socket in question, right?

What is "f_offset"?


Trenton D. Adams
Extreme Engineering
#17, 6025 - 12 St. SE
Calgary, Alberta, Canada
T2H 2K1

Phone: 403 640 9494 ext-208
Fax: 403 640 9599

http://www.extremeeng.com

             reply	other threads:[~2001-08-23 15:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-23 15:31 Trenton D. Adams [this message]
2001-08-23 19:10 ` [ECOS] How to build RedBoot for S3C4510 Simon
2001-08-23 19:15   ` Gary Thomas
2001-08-23 20:09     ` Simon
2001-08-24  4:57       ` Gary Thomas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='000701c12c23$5e4c49e0$090110ac@TRENT' \
    --to=tadams@theone.dnsalias.com \
    --cc=ecos-discuss@sourceware.cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).