Esempio n. 1
0
static int
FRMR_error(struct PStack *st, struct sk_buff *skb)
{
	int headers = l2addrsize(&st->l2) + 1;
	u_char *datap = skb->data + headers;
	int rsp = *skb->data & 0x2;

	if (test_bit(FLG_ORIG, &st->l2.flag))
		rsp = !rsp;

	if (!rsp)
		return 'L';

	if (test_bit(FLG_MOD128, &st->l2.flag)) {
		if (skb->len < headers + 5)
			return 'N';
		else
			l2m_debug(&st->l2.l2m, "FRMR information %2x %2x %2x %2x %2x",
				datap[0], datap[1], datap[2],
				datap[3], datap[4]);
	} else {
		if (skb->len < headers + 3)
			return 'N';
		else
			l2m_debug(&st->l2.l2m, "FRMR information %2x %2x %2x",
				datap[0], datap[1], datap[2]);
	}

	return 0;
}
Esempio n. 2
0
static int
FRMR_error(struct layer2 *l2, struct sk_buff *skb)
{
	u_int	headers = l2addrsize(l2) + 1;
	u_char	*datap = skb->data + headers;
	int	rsp = *skb->data & 0x2;

	if (test_bit(FLG_ORIG, &l2->flag))
		rsp = !rsp;
	if (!rsp)
		return 'L';
	if (test_bit(FLG_MOD128, &l2->flag)) {
		if (skb->len < headers + 5)
			return 'N';
		else if (*debug & DEBUG_L2)
			l2m_debug(&l2->l2m,
			    "FRMR information %2x %2x %2x %2x %2x",
			    datap[0], datap[1], datap[2], datap[3], datap[4]);
	} else {
		if (skb->len < headers + 3)
			return 'N';
		else if (*debug & DEBUG_L2)
			l2m_debug(&l2->l2m,
			    "FRMR information %2x %2x %2x",
			    datap[0], datap[1], datap[2]);
	}
	return 0;
}
Esempio n. 3
0
int
FRMR_error(layer2_t *l2, msg_t *msg)
{
	int headers = l2addrsize(l2) + 1;
	u_char *datap = msg->data + headers;
	int rsp = *msg->data & 0x2;

	if (test_bit(FLG_ORIG, &l2->flag))
		rsp = !rsp;
	if (!rsp)
		return 'L';
	if (test_bit(FLG_MOD128, &l2->flag)) {
		if (msg->len < headers + 5)
			return 'N';
		else
			l2m_debug(&l2->l2m, "FRMR information %2x %2x %2x %2x %2x",
				datap[0], datap[1], datap[2],
				datap[3], datap[4]);
	} else {
		if (msg->len < headers + 3)
			return 'N';
		else
			l2m_debug(&l2->l2m, "FRMR information %2x %2x %2x",
				datap[0], datap[1], datap[2]);
	}
	return 0;
}