}
}
-void GREProtocol::send_packet(uint16_t proto, const string &data)
+void GREProtocol::send_packet(uint16_t proto, const string &data, int incoming_seq)
{
char buf[4096];
gre_header *gre = (gre_header *)buf;
gre->protocol_type = htons(proto);
char *ptr = buf + sizeof(*gre);
- int seq_be = htonl(seq++);
+ int seq_be = htonl(seq++); // Ignore incoming_seq.
memcpy(ptr, &seq_be, sizeof(seq_be));
ptr += sizeof(seq_be);
return sock;
}
-void GREProtocol::read_packet(Reorderer *sender)
+void GREProtocol::read_packet(Protocol *sender)
{
struct sockaddr_storage addr;
socklen_t addrlen = sizeof(addr);
//printf("gre packet: proto=%x\n", ntohs(gre->protocol_type));
- sender->handle_packet(ntohs(gre->protocol_type), string(ptr, buf + ret), seq);
+ sender->send_packet(ntohs(gre->protocol_type), string(ptr, buf + ret), seq);
}