[lib-client] Change the prefix for "owl_"
Use the prefix "owl_" instead of "owlclient_".
This commit is contained in:
parent
32d8a04ad5
commit
ff17c92bfa
|
@ -16,7 +16,7 @@
|
|||
* 'iface' if specified (if you want the interface to be selected,
|
||||
* automatically, this parameter should be NULL or an empty string).
|
||||
*/
|
||||
int owlclient_create_trx_socket(const char *const dest_ip,
|
||||
int owl_create_trx_socket(const char *const dest_ip,
|
||||
const uint_fast16_t dest_port,
|
||||
struct sockaddr_in *const server,
|
||||
const char *const iface)
|
||||
|
@ -34,7 +34,7 @@ int owlclient_create_trx_socket(const char *const dest_ip,
|
|||
|
||||
// If we specified an interface name
|
||||
if (iface != NULL && iface[0] != '\0')
|
||||
owlclient_use_iface(sockfd, iface) ;
|
||||
owl_use_iface(sockfd, iface) ;
|
||||
|
||||
return sockfd ;
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ int owlclient_create_trx_socket(const char *const dest_ip,
|
|||
|
||||
|
||||
/* Selects 'iface' as sending interface for the socket 'sockfd'. */
|
||||
void owlclient_use_iface(const int sockfd, const char *const iface)
|
||||
void owl_use_iface(const int sockfd, const char *const iface)
|
||||
{
|
||||
#ifdef __GLIBC__
|
||||
if (setsockopt(sockfd, SOL_SOCKET, SO_BINDTODEVICE, iface,
|
||||
|
@ -66,7 +66,7 @@ void owlclient_use_iface(const int sockfd, const char *const iface)
|
|||
* nb_pkt: number of packets to transmit.
|
||||
* delay: delay between two transmissions, in milliseconds.
|
||||
*/
|
||||
void owlclient_send_request(const int sockfd,
|
||||
void owl_send_request(const int sockfd,
|
||||
const struct sockaddr_in *const server,
|
||||
const void *const packet,
|
||||
const uint_fast16_t packet_size,
|
||||
|
@ -83,13 +83,13 @@ void owlclient_send_request(const int sockfd,
|
|||
#endif // DEBUG
|
||||
|
||||
// Transmit first packet:
|
||||
owlclient_send_packet(sockfd, server, packet, packet_size) ;
|
||||
owl_send_packet(sockfd, server, packet, packet_size) ;
|
||||
|
||||
// Transmit remaining packets (if any):
|
||||
for (i = 0 ; i < nb_pkt - 1 ; ++i)
|
||||
{
|
||||
usleep(delay * 1000) ; // Wait during the wanted delay
|
||||
owlclient_send_packet(sockfd, server, packet, packet_size) ;
|
||||
owl_send_packet(sockfd, server, packet, packet_size) ;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
|
@ -99,7 +99,7 @@ void owlclient_send_request(const int sockfd,
|
|||
|
||||
|
||||
|
||||
void owlclient_send_packet(const int sockfd,
|
||||
void owl_send_packet(const int sockfd,
|
||||
const struct sockaddr_in *const server,
|
||||
const void *const packet,
|
||||
const uint_fast16_t packet_size)
|
||||
|
|
|
@ -14,18 +14,18 @@
|
|||
|
||||
|
||||
/* Function headers */
|
||||
int owlclient_create_trx_socket(const char *const dest_ip,
|
||||
int owl_create_trx_socket(const char *const dest_ip,
|
||||
const uint_fast16_t dest_port,
|
||||
struct sockaddr_in *const server,
|
||||
const char *const iface) ;
|
||||
void owlclient_use_iface(const int sockfd, const char *const iface) ;
|
||||
void owlclient_send_request(const int sockfd,
|
||||
void owl_use_iface(const int sockfd, const char *const iface) ;
|
||||
void owl_send_request(const int sockfd,
|
||||
const struct sockaddr_in *const server,
|
||||
const void *const packet,
|
||||
const uint_fast16_t packet_size,
|
||||
const uint_fast16_t nb_pkt,
|
||||
const uint_fast32_t delay) ;
|
||||
void owlclient_send_packet(const int sockfd,
|
||||
void owl_send_packet(const int sockfd,
|
||||
const struct sockaddr_in *const server,
|
||||
const void *const packet,
|
||||
const uint_fast16_t packet_size) ;
|
||||
|
|
|
@ -373,7 +373,7 @@ void print_configuration()
|
|||
void create_socket()
|
||||
{
|
||||
sockfd =
|
||||
owlclient_create_trx_socket(options.dest_ip, options.dest_port,
|
||||
owl_create_trx_socket(options.dest_ip, options.dest_port,
|
||||
&server, options.iface) ;
|
||||
}
|
||||
|
||||
|
@ -443,7 +443,7 @@ void make_packet()
|
|||
|
||||
void send_request()
|
||||
{
|
||||
owlclient_send_request(sockfd, &server, packet, packet_size,
|
||||
owl_send_request(sockfd, &server, packet, packet_size,
|
||||
options.nb_pkt, options.delay) ;
|
||||
}
|
||||
|
||||
|
|
|
@ -749,8 +749,7 @@ int capture()
|
|||
|
||||
/* Open UDP socket to the aggregator */
|
||||
aggregation_sockfd =
|
||||
owlclient_create_trx_socket(GET_AGGREGATION_IP(),
|
||||
GET_AGGREGATION_PORT(),
|
||||
owl_create_trx_socket(GET_AGGREGATION_IP(), GET_AGGREGATION_PORT(),
|
||||
&aggregation_server, NULL) ;
|
||||
|
||||
while (owl_run)
|
||||
|
@ -1215,16 +1214,15 @@ void* autocalibrate_hello(void *NULL_value)
|
|||
fprintf(stderr, "Autocalibration Hello thread launched.\n") ;
|
||||
|
||||
send_sockfd =
|
||||
owlclient_create_trx_socket(GET_AGGREGATION_IP(),
|
||||
GET_AUTOCALIBRATION_PORT(),
|
||||
&serv, NULL) ;
|
||||
owl_create_trx_socket(GET_AGGREGATION_IP(),
|
||||
GET_AUTOCALIBRATION_PORT(), &serv, NULL) ;
|
||||
pthread_cleanup_push(&owl_close_fd, &send_sockfd) ;
|
||||
|
||||
memcpy(&message.ap_mac_addr_bytes, my_mac_bytes, ETHER_ADDR_LEN) ;
|
||||
|
||||
while (owl_run)
|
||||
{
|
||||
owlclient_send_packet(send_sockfd, &serv,
|
||||
owl_send_packet(send_sockfd, &serv,
|
||||
&message, sizeof(message)) ;
|
||||
sleep(GET_AUTOCALIBRATION_HELLO_DELAY()) ;
|
||||
}
|
||||
|
@ -1250,7 +1248,7 @@ void* autocalibrate(void *NULL_value)
|
|||
|
||||
// Socket to send autocalibration positioning requests
|
||||
autocalibration_send_sockfd =
|
||||
owlclient_create_trx_socket(GET_AUTOCALIBRATION_IP(),
|
||||
owl_create_trx_socket(GET_AUTOCALIBRATION_IP(),
|
||||
GET_AUTOCALIBRATION_REQUEST_PORT(),
|
||||
&autocalibration_send_server,
|
||||
GET_WIFI_IFACE()) ;
|
||||
|
@ -1303,7 +1301,7 @@ void send_autocalibration_request()
|
|||
uint8_t *packet ;
|
||||
uint_fast16_t packet_size = make_packet(&packet) ;
|
||||
|
||||
owlclient_send_request(autocalibration_send_sockfd,
|
||||
owl_send_request(autocalibration_send_sockfd,
|
||||
&autocalibration_send_server,
|
||||
packet, packet_size,
|
||||
GET_AUTOCALIBRATION_NBPKT(),
|
||||
|
|
Loading…
Reference in New Issue