HP rp5430 HP DLPI Programmer's Guide - Page 205
result |= GOT_DATA, err_ack->dl_error_primitive
View all HP rp5430 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 205 highlights
Sample Programs Connectionless Mode Example result |= GOT_CTRL; } if(data_buf.len > 0) { result |= GOT_DATA; } return(result); } check that control message is the expected message void check_ctrl(ex_prim) intex_prim;/* the expected primitive */ { dl_error_ack_t*err_ack = (dl_error_ack_t *)ctrl_area; /* did we get the expected primitive? */ if(err_ack->dl_primitive != ex_prim) { /* did we get a control part */ if(ctrl_buf.len) { /* yup; is it an ERROR_ACK? */ if(err_ack->dl_primitive == DL_ERROR_ACK) { /* yup; format the ERROR_ACK info */ printf("error: expected primitive 0x%02x, ", ex_prim); printf("got DL_ERROR_ACK\n"); printf(" dl_error_primitive = 0x%02x\n", err_ack->dl_error_primitive); printf(" dl_errno = 0x%02x\n", err_ack->dl_errno); printf(" dl_unix_errno = %d\n", err_ack->dl_unix_errno); exit(1); } else { /* didn't get an ERROR_ACK either; print whatever primitive we did get */ printf("error: expected primitive 0x%02x, ", ex_prim); printf("got primitive 0x%02x\n", err_ack->dl_primitive); exit(1); } } else { Appendix A 205