Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: john@iastate.edu (John Hascall)
Subject: Network ioctl confusion
Date: 13 Jan 1994 21:50:00 GMT	[thread overview]
Message-ID: <2h4fm8$bbr@news.iastate.edu> (raw)

(DEC OSF/1 1.3, FYI)

------------------- From the netintro man page ----------------------------
  The following ioctl calls may be used to manipulate network interfaces.
    ...
  Calls which are now deprecated are:
    ...
  SIOCSIFFLAGS
            Set interface flags field.  If the interface is marked down, any
            processes currently routing packets through the interface are
            notified; some interfaces may be reset so that incoming packets
            are no longer received.  When marked up again, the interface is
            reinitialized.
    ...
  There are three requests that make use of a new structure:

  SIOCAIFADDR
                             This request provides a means to add additional
            addresses (or modify characteristics of the primary address if
            the default address for the address family is specified).  Rather
            than making separate calls to set destination addresses,
            broadcast addresses, or network masks (now an integral feature of
            multiple protocols) a separate structure is used to specify all
            three facets simultaneously:
            struct ifaliasreq {
                    char    ifra_name[IFNAMSIZ];      /* if name, e.g. "en0" */
                    struct  sockaddr        ifra_addr;
                    struct  sockaddr        ifra_broadaddr;
                    struct  sockaddr        ifra_mask;
            };

  SIOCDIFADDR
            This request deletes the specified address from the list associ-
            ated with an interface.  ...

  SIOCGIFCONF
            Get interface configuration list.  This request takes an ifconf
            structure ...
-------------------------- end of netintro man page excerpt -------------------

Now, it appears that there are only 2 (not 3) requests which use the new
"struct ifaliasreq".  Of course, /usr/include/sys/ioctl.h claims that
only 1 request uses "struct ifaliasreq"...  So, at least 2 of the 3 are
wrong...
------------------------- ioctl.h excerpt -------------------------------------
#define SIOCDIFADDR     _IOW('i', 25, struct ifreq)     /* delete IF addr */
#define SIOCAIFADDR     _IOW('i', 26, struct ifaliasreq)/* add/chg IF alias */
-------------------------------------------------------------------------------

But, what I really wanted to know was, if "SIOCSIFFLAGS" is deprecated,
and given:
            struct ifaliasreq {
                    char    ifra_name[IFNAMSIZ];      /* if name, e.g. "en0" */
                    struct  sockaddr        ifra_addr;
                    struct  sockaddr        ifra_broadaddr;
                    struct  sockaddr        ifra_mask;
            };

what is the non-deprecated way to set the interface flags???


John
-- 
John Hascall                   ``An ill-chosen word is the fool's messenger.''
Systems Software Engineer
Project Vincent
Iowa State University Computation Center  +  Ames, IA  50011  +  515/294-9551


                 reply	other threads:[~1994-01-13 21:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox