Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 Sep 2001 14:25:02 -0700
From:      Bill Fenner <fenner@research.att.com>
To:        karels@bsdi.com
Cc:        arch@freebsd.org
Subject:   Re: Causing <netinet/in.h> to depend on <sys/socket.h>
Message-ID:  <200109072125.OAA25298@windsor.research.att.com>

next in thread | raw e-mail | index | archive | help

Sorry for making people guess what I was talking about.

Concretely, http://www.ietf.org/internet-drafts/draft-ietf-idmr-msf-api-02.txt
requires that #including <netinet/in.h> results in definitions like
the following:


struct group_req {
   uint32_t                gr_interface; /* interface index */
   struct sockaddr_storage gr_group;     /* group address */
};

struct group_source_req {
   uint32_t                gsr_interface; /* interface index */
   struct sockaddr_storage gsr_group;     /* group address */
   struct sockaddr_storage gsr_source;    /* source address */
};

struct group_filter {
   uint32_t                gf_interface; /* interface index */
   struct sockaddr_storage gf_group;     /* multicast address */
   uint32_t                gf_fmode;     /* filter mode */
   uint32_t                gf_numsrc;    /* number of sources */
   struct sockaddr_storage gf_slist[1];  /* source address */
};


Since they're not pointers, forward struct declarations don't work.

Since "struct sockaddr_storage" is defined in <sys/socket.h>,
the easy thing to do is to pull in <sys/socket.h>.

Mike, I guess the point of your <sys/sockettypes.h> would be to include
only the common elements and so
a) limit the namespace pollution when not #including <sys/socket.h>
b) limit the size of the header that's re-parsed (smaller sys/sockettypes.h
instead of larger sys/socket.h when a source file includes netinet/in.h
followed by sys/socket.h)
?

Thanks,
  Bill

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200109072125.OAA25298>