This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uint32_t get_lower_32_bits(uint64_t i) | |
{ | |
return (uint32_t) i; | |
} | |
uint32_t get_higher_32_bits(uint64_t i) | |
{ | |
return (uint32_t) (i >> 32); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct sockaddr_in s; | |
int fd_socket = socket(PF_INET, SOCK_DGRAM, 0); | |
int bcastEnable = 1; | |
int32_t data = 1; | |
if (fd_socket < 0) | |
perror("socket"); | |
if(setsockopt(fd_socket, SOL_SOCKET, SO_BROADCAST, &bcastEnable, sizeof(bcastEnable))) | |
perror("setsockopt"); | |
memset(&s, 0, sizeof(struct sockaddr_in)); |