public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] making netstat () diagnostic function
@ 2001-08-23 15:31 Trenton D. Adams
  2001-08-23 19:10 ` [ECOS] How to build RedBoot for S3C4510 Simon
  0 siblings, 1 reply; 5+ messages in thread
From: Trenton D. Adams @ 2001-08-23 15:31 UTC (permalink / raw)
  To: 'eCos Discussion'

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

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

end of thread, other threads:[~2001-08-24  4:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-23 15:31 [ECOS] making netstat () diagnostic function Trenton D. Adams
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

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).