[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Question on optional connect data field



Hi all,

I'm trying to establish a DECnet connection to a remote DECnet 
named object. I've been looking through the phoned code, and 
from that I assume I should be using something along the lines of:

out_fd = socket(AF_DECnet, SOCK_SEQPACKET, DNPROTO_NSP)

out_sockaddr.sdn_family    = AF_DECnet;
out_sockaddr.sdn_flags     = 0x00;
out_sockaddr.sdn_objnum    = 0x00;
out_sockaddr.sdn_objnamel  = obj_name_len;
out_sockaddr.sdn_objname   = obj_name;
out_sockaddr.sdn_add.a_len = 0x02;

out_sockaddr.sdn_add.a_addr = dest_addr;


connect(out_fd, &out_sockaddr, len_out_sockaddr)


OK, here comes the question:

I want to send up to 16 bytes of optional user data in the connect
message. 
I know that *somewhere* in the code is the capability to do it, as 
there's a structure defined in dn.h as:

struct optdata_dn {
        unsigned short  opt_status;     /* Extended status return */
#define opt_sts opt_status
        unsigned short  opt_optl;       /* Length of user data    */
        unsigned char   opt_data[16];   /* User data              */
};


So ... where does this fit in when I'm doing a 'connect()' ? ... or is
there some other secret alternative to 'connect' ?

Also, at the other end of the connection, how do I retrieve the optional
user data from the connect message ? I was planning on using select()
and accept() and read(), but I'm not sure where the optional data would
appear? ... maybe at the accept() stage ? How do I get at it?


Thanks in advance.

Rob.
-----------------------------------------------------------------------------
To unsubscribe from this list, send a mail to majordomo@dreamtime.org
containing the line "unsubscribe linux-decnet"
-----------------------------------------------------------------------------