usr.bin/tn3270/api/api_exch.c
/*
 * Receive the exch structure from the other side, checking
 * sequence numbering.
 */
Receive the exch structure from the other side, checking
sequence numbering.
Receive the exch structure from the other side checking sequence numbering .
static int
receive_state()
{
    if (iget((char *)&exch_state, sizeof exch_state) == -1) {
	return -1;
    }
    if (conversation != CONTENTION) {
	if (exch_state.your_sequence != my_sequence) {
	    WHO_ARE_WE();
	    fprintf(stderr, "Send sequence number mismatch.\n");
	    return -1;
	}
	if (exch_state.my_sequence != ((++your_sequence)&0xff)) {
	    WHO_ARE_WE();
	    fprintf(stderr, "Receive sequence number mismatch.\n");
	    return -1;
	}
    }
    your_sequence = exch_state.my_sequence;
    return 0;
}
static int receive_state ( ) { if ( iget ( ( char * ) & exch_state , sizeof exch_state ) == -1 ) { return -1 ; } if ( conversation != CONTENTION ) { if ( exch_state . your_sequence != my_sequence ) { WHO_ARE_WE ( ) ; fprintf ( stderr , " \n " ) ; return -1 ; } if ( exch_state . my_sequence != ( ( ++ your_sequence ) & 0xff ) ) { WHO_ARE_WE ( ) ; fprintf ( stderr , " \n " ) ; return -1 ; } } your_sequence = exch_state . my_sequence ; return 0 ; }
Receive the exch structure from the other side, checking
 sequence numbering.
Receive the exch structure from the other side checking sequence numbering .