#include <semaphore.h>
#include <sys/ioctl.h>
#include <net/if.h>
+#include <inttypes.h>
#ifdef WITH_FWP
#include <fwp_confdefs.h>
real[0]=0;
}
- snprintf(stream_desc, n, "%d: %s %s (%d bytes per %s +-%s, %d packets/s)%s",
+ snprintf(stream_desc, n, "%"PRIdPTR": %s %s (%d bytes per %s +-%s, %d packets/s)%s",
stream-streams, ac_to_text[stream->ac], bandwidth_to_text(buf[0], stream->bandwidth_bps),
stream->packet_size, usec_to_text(buf[1], stream->period_usec),
usec_to_text(buf[2], stream->jitter*stream->period_usec/100),
exit(0);
}
-int create_ac_socket(unsigned int ac)
+int create_ac_socket(intptr_t ac)
{
int sockfd;
unsigned int yes=1, tos;
}
#ifndef WITH_FWP
-int recv_packet_native(unsigned ac, struct msg_t *msg)
+int recv_packet_native(intptr_t ac, struct msg_t *msg)
{
int mlen, ret;
fd_set fdset;
struct timespec ts;
uint64_t send_timestamp, server_timestamp, recv_timestamp;
int mlen;
- unsigned ac;
+ intptr_t ac;
min_trans_time = ~0;
ac = stream->ac;
mlen = recv_packet_fwp(stream, &msg);
#else
- ac = (unsigned)arg;
+ ac = (intptr_t)arg;
mlen = recv_packet_native(ac, &msg);
#endif
if (mlen < 0) {
}
if (packet_size < sizeof(struct msg_t)) {
- error(1, 0, "Packet size too small (min %d)", sizeof(struct msg_t));
+ error(1, 0, "Packet size too small (min %zd)", sizeof(struct msg_t));
}
stream->packet_size = packet_size;
error(1, errno, "FWP initialization failed");
}
#else
- int ac;
+ intptr_t ac;
/* create four receivers each per AC */
for (ac = AC_NUM - 1; ac >= 0; ac--) {
ac_sockfd[ac] = create_ac_socket(ac);
union msg_buff buff;
struct sockaddr_in rem_addr;
int mlen;
- unsigned int ac, rem_addr_length;
+ unsigned int rem_addr_length;
+ intptr_t ac;
char cbufrec[512], cbufsend[512];
struct iovec iov;
struct msghdr msg;
struct in_pktinfo *ipi = NULL;
struct timespec ts;
- ac = (int) queue;
+ ac = (intptr_t) queue;
rem_addr_length=sizeof(rem_addr);
block_signals();
int main(int argc, char *argv[])
{
- int ac,rc;
+ int rc;
+ intptr_t ac;
pthread_attr_t attr;
pthread_t thread;