Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: thomas@lkg.dec.com (Matt Thomas)
Subject: Re: [Q] ioctl arguments with XTI_SOSETOPT?
Date: 29 Jul 1994 15:02:35 GMT	[thread overview]
Message-ID: <31b5mb$9s6@nntpd.lkg.dec.com> (raw)
In-Reply-To: 31as70$2te@mrnews.mro.dec.com


In article <31as70$2te@mrnews.mro.dec.com>, pbs@zuunix.zuo.dec.com (Philip Shearer @ZUO-DC EBS-Team) writes:
|>What is the structure and the content of the ioctl command mentioned in
|>/usr/include/xtiext.h
|>
|>For example if I was using sockets:
|>{
|> int sendbuf = 1 ;
|> int option = SO_KEEPALIVE ;
|> setsockopt(fd,SOL_SOCKET,option,&sendbuf,sizeof(sendbuf)) ;
|>}
|>
[...]
|>
|>Suplementry questions: Is it true that one can not set TCP/IP options
|>using t_optmgmt and if so why was it not implemented?
|>
|>TTFN Philip
|>

You guessed wrong.  But you were close.  These are done through a streams
(I_STR) ioctl.  For example:

    struct xtisoioctl xti_ioc;
    struct strioctl ioc;

    ioc.ic_cmd = XTI_SOSETOPT;
    ioc.ic_timout = 0;
    ioc.ic_len = sizeof(xti_ioc);
    ioc.ic_dp = (caddr_t) &xti_ioc;

    xti_ioc.level = SOL_SOCKET;
    xti_ioc.opt.len = sizeof(int);
    xti_ioc.opt.maxlen = sizeof(int);
    xti_ioc.optname = SO_KEEPALIVE;
    xti_ioc.opt.buf = (caddr_t) ((flags & RL_KEEPALIVE) ? &on : &off);
    if (ioctl(fd, I_STR, &ioc) < 0) {
        syslog(LOG_DEBUG, "fatal: can't %s SO_KEEPALIVE: %s\n",
               (flags & RL_KEEPALIVE) ? "enable" : "disable",
               strerror(errno));
        if (debug)
            fprintf(stderr, "%s: fatal: can't %s SO_KEEPALIVE: %s\n",
                    PROGNAME, (flags & RL_KEEPALIVE) ? "enable" : "disable",
                    strerror(errno));
        exit(EX_OSERR);
    }

|>Suplementry questions: Is it true that one can not set TCP/IP options
|>using t_optmgmt and if so why was it not implemented?

You can't use t_optmgmt for TCP/IP.  And that's because the XPG3 options
defined for TCP/IP are basicly useless.  XPG4 is much better but DEC OSF/1
does not a XPG4 compliant XTI yet.

-- 
Matt Thomas                          Internet:   thomas@lkg.dec.com
U*X Networking                       WWW URL:    http://ftp.dec.com/%7Ethomas/
Digital Equipment Corporation        Disclaimer: This message reflects my
Littleton, MA                                    own warped views, etc.


  reply	other threads:[~1994-07-29 15:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-07-29 12:20 [Q] ioctl arguments with XTI_SOSETOPT? Philip Shearer @ZUO-DC EBS-Team
1994-07-29 15:02 ` Matt Thomas [this message]
1994-07-29 15:34   ` Mary Walker
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