if((parsedat[2]&(~MODE_ACK))!=tw->linemode_mask && !(parsedat[2]&MODE_ACK)) { /* ignore the mode change if it is the same as the current one, or if the MODE_ACK bit is set */
if(parsedat[2]&MODE_EDIT) /* check for line buffering/editting */
tw->lmedit=1;
else /* character buffering */
tw->lmedit=0;
if(parsedat[2]&MODE_TRAPSIG) /* check for local signal trapping */
tw->trapsig=1;
else
tw->trapsig=0;
if(parsedat[2]&MODE_SOFT_TAB) /* check for tab expansion */
tw->softtab=1;
else
tw->softtab=0;
if(parsedat[2]&MODE_SOFT_TAB) /* check for literal echo */
tw->litecho=1;
else
tw->litecho=0;
parsedat[2]&=LINEMODE_MODES_SUPPORTED; /* mask off any modes we don't support */
tw->linemode_mask=parsedat[2]; /* save the new linemode MODE */
if(parsedat[i+1]&SLC_FLUSHIN) /* check for FLUSH INPUT flag */
tprintf(cv,"|SLC_FLUSHIN");
if(parsedat[i+1]&SLC_FLUSHOUT) /* check for FLUSH OUTPUT flag */
tprintf(cv,"|SLC_FLUSHOUT");
if(parsedat[i+1]&SLC_ACK) /* check for ACK flag */
tprintf(cv,"|SLC_ACK");
tprintf(cv," %d\r\n",(unsigned)parsedat[i+2]);
} /* end if */
if(tw->slc[parsedat[i]]!=parsedat[i+2]) { /* check the new character for the function against our current character for that function */
if((tw->slm[parsedat[i]]&SLC_LEVELBITS)==(parsedat[i+1]&SLC_LEVELBITS) && (parsedat[i+1]&SLC_ACK)) { /* if it's the same level as we have, and the ACK flag is set, just use the new value */
tw->slc[parsedat[i]]=parsedat[i+2];
} /* end if */
else { /* level for the function is not the same, or the ACK flag is not set */
if(!(parsedat[i+1]&SLC_ACK)) { /* if the ACK bit isn't set, then work with it */
if(line_opt_flag==0) { /* check whether we've started the negotiations yet */
if(tw->condebug>0) /* check for debugging ouput */
tprintf(cv,"SEND: SB LINEMODE SLC\r\n");
} /* end if */
if((parsedat[i]<=NUMLMODEOPTIONS) && (tw->slm[parsedat[i]]&SLC_SUPPORTED)) { /* only try to parse linemode sub-options we have a clue about, and we support */
switch(parsedat[i+1]&SLC_LEVELBITS) {
case SLC_NOSUPPORT: /* other side doesn't support this function */
tw->slc[parsedat[i]]=(-1); /* make certain we don't match it */
tw->slm[parsedat[i]]&=~SLC_LEVELBITS; /* mask off the correct characters */