Commit 6315d6b5 authored by Joanne Hugé's avatar Joanne Hugé

Set enable_etf to 0 as default

parent ec8f58e5
......@@ -113,6 +113,7 @@ int main(int argc, char *argv[]) {
param.max_cycles = 0;
param.priority = 99;
param.enable_affinity = 0;
param.enable_etf = 0;
main_param.refresh_rate = 50000;
......
......@@ -94,12 +94,12 @@ int send_udp_packet(const char *server_ip) {
static int so_priority = 3;
static struct sock_txtime sk_txtime;
static uint32_t tx_buffer = MESSAGE;
static uint32_t tx_buffer_len = sizeof(MESSAGE);
static unsigned char tx_buffer[1024] = "Hi";
static size_t tx_buffer_len = sizeof(tx_buffer);
static int fd;
// Sets the interface
static int set_if(char * network_if) {
static int set_if(char *network_if) {
struct ifreq ifreq;
memset(&ifreq, 0, sizeof(ifreq));
......@@ -114,7 +114,7 @@ static int set_if(char * network_if) {
/*
* Init UDP socket
*/
void init_udp_etf(int use_etf, char * network_if) {
void init_udp_etf(int use_etf, char *network_if) {
int index;
fd = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP);
......@@ -127,7 +127,8 @@ void init_udp_etf(int use_etf, char * network_if) {
sizeof(so_priority)))
error(EXIT_FAILURE, errno, "Couldn't set socket priority\n");
if (setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, network_if, strlen(network_if)))
if (setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, network_if,
strlen(network_if)))
error(EXIT_FAILURE, errno, "setsockopt SO_BINDTODEVICE failed\n");
if (use_etf) {
......@@ -178,5 +179,6 @@ void send_udp_packet_etf(int use_etf, uint64_t txtime, const char *server_ip) {
}
sendmsgerr = sendmsg(fd, &msg, 0);
if (sendmsgerr) error(EXIT_FAILURE, errno, "sendmsg failed, ret value: %d\n", sendmsgerr);
if (sendmsgerr < 0)
error(EXIT_FAILURE, errno, "sendmsg failed, ret value: %d\n", sendmsgerr);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment