|
|
|
@ -10,6 +10,10 @@
|
|
|
|
|
extern _point debug_field;
|
|
|
|
|
extern int debug_lastping;
|
|
|
|
|
|
|
|
|
|
static short int pkg_lastid; /* the packet id, this will only counted
|
|
|
|
|
up nothing more.. if we are at 0x10000
|
|
|
|
|
we will start at 0 */
|
|
|
|
|
|
|
|
|
|
struct _resend_cache resend_cache;
|
|
|
|
|
struct _inpkg_index inpkg_index[PKG_IN_INDEX_NUM];
|
|
|
|
|
int inpkg_index_pos = 0;
|
|
|
|
@ -908,9 +912,10 @@ inpkg_check (unsigned char typ, short int id, _net_addr * addr)
|
|
|
|
|
/* find packet */
|
|
|
|
|
for (i = 0, pos = -1; (i < PKG_IN_INDEX_NUM && pos == -1); i++)
|
|
|
|
|
if (inpkg_index[i].pl_nr == addr->pl_nr &&
|
|
|
|
|
inpkg_index[i].typ == typ && inpkg_index[i].id == id)
|
|
|
|
|
inpkg_index[i].typ == typ && inpkg_index[i].id == id) {
|
|
|
|
|
printf ("typ: %d, id: %d\n", typ, id);
|
|
|
|
|
pos = i;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (pos == -1) {
|
|
|
|
|
/* packet unknown ... add to index */
|
|
|
|
|
if (++inpkg_index_pos >= PKG_IN_INDEX_NUM)
|
|
|
|
@ -929,7 +934,7 @@ inpkg_check (unsigned char typ, short int id, _net_addr * addr)
|
|
|
|
|
void
|
|
|
|
|
send_pkg (struct pkg *packet, _net_addr * addr)
|
|
|
|
|
{
|
|
|
|
|
packet->h.id = s_random (256);
|
|
|
|
|
packet->h.id = pkg_lastid++;
|
|
|
|
|
if (bman.net_ai_family != PF_INET)
|
|
|
|
|
packet->h.flags = packet->h.flags | PKGF_ipv6;
|
|
|
|
|
udp_send (bman.sock, (char *) packet, packet->h.len, &addr->sAddr, bman.net_ai_family);
|
|
|
|
|