// aiee, no crypto info yet! :-)
s_mark_end(s);
- printf("LEN: %u\n", s->p - s->data);
+ printf("LEN: %u\n", s->p - s->iso_hdr);
iso_send(s);
}
in_uint8(s, opcode);
appid = opcode >> 2;
- if (appid != MCS_SDIN)
- {
- if (appid != MCS_DPUM)
- {
- error("expected data, got %d\n", opcode);
- }
+
+ switch (appid) {
+ case MCS_SDIN:
+ in_uint8s(s, 2); /* userid */
+ in_uint16_be(s, *channel);
+ in_uint8s(s, 1); /* flags */
+ in_uint8(s, length);
+ if (length & 0x80)
+ in_uint8s(s, 1); /* second byte of length */
+
+ return s;
+ case MCS_DPUM:
+ return NULL;
+ case MCS_EDRQ:
+ // Erect Domain (ignore)
+ printf("Received EDrq\n");
+ return NULL;
+ default:
+ error("expected data, got %d\n", opcode);
return NULL;
}
- in_uint8s(s, 2); /* userid */
- in_uint16_be(s, *channel);
- in_uint8s(s, 1); /* flags */
- in_uint8(s, length);
- if (length & 0x80)
- in_uint8s(s, 1); /* second byte of length */
-
- return s;
}
/* Disconnect from the MCS layer */
for ( ;; ) {
short channel;
+ STREAM *s;
/* receive ISO packets */
- mcs_recv(&channel);
-
- printf("Packet on ch %u\n", channel);
+ s = mcs_recv(&channel);
+ if (s != NULL)
+ printf("Packet on ch %u\n", channel);
}
}