Пример #1
0
static int is_pkt_acked(const uint8_t *wp, struct ether_addr *last_ta,
			uint16_t seqnr)
{
	/* Normal ACK with correct RA */
	if (get_pkt_type(wp) == 0x1d && cmp_eth(wp + RA_POS, last_ta))
		return 1;

	/* BA. Only BA directly after data frame is checked */
	if (get_pkt_type(wp) == 0x19 && cmp_eth(wp + RA_POS, last_ta)) {
		const uint8_t *bm = wp + BA_BM_POS;
		uint16_t ssn;
		int bit_offset, byte, bit;

		ssn = get_ssn(wp);
		bit_offset = seqnr - ssn;

		if (bit_offset > 63)
			return 0;

		byte = bit_offset / 8;
		bit = bit_offset % 8;
		return !!(bm[byte] & 1 << bit);
	}

	return 0;
}
Пример #2
0
void HourlyEmployee::print_check( )
{
    set_net_pay(hours * wage_rate);

    cout << "\n________________________________________________\n";
    cout << "Pay to the order of " << get_name( ) << endl;
    cout << "The sum of " << get_net_pay( ) << " Dollars\n";
    cout << "________________________________________________\n";
    cout << "Check Stub: NOT NEGOTIABLE\n";
    cout << "Employee Number: " << get_ssn( ) << endl;
    cout << "Hourly Employee. \nHours worked: " << hours
         << " Rate: " << wage_rate << " Pay: " << get_net_pay( ) << endl;
    cout << "_________________________________________________\n";
}