+
+static void ot_setoption(EndpointRef ep,
+ OTXTILevel level,
+ OTXTIName name,
+ UInt32 value)
+{
+ TOption option;
+ TOptMgmt request;
+ TOptMgmt result;
+
+ if (name == TCP_KEEPALIVE) {
+ option.len = sizeof(struct t_kpalive);
+ option.value[1] = T_UNSPEC;
+ } else
+ option.len = kOTFourByteOptionSize;
+ option.level = level;
+ option.name = name;
+ option.status = 0;
+ option.value[0] = value;
+
+ request.opt.buf = (unsigned char *) &option;
+ request.opt.len = sizeof(option);
+ request.flags = T_NEGOTIATE;
+
+ result.opt.buf = (unsigned char *) &option;
+ result.opt.maxlen = sizeof(option);