[lib-client] Change function prefix (owlclient_)
Change the function prefix from "owlps_" to "owlclient_".
This commit is contained in:
parent
7c80f17b0b
commit
0045ba8a14
|
@ -12,7 +12,7 @@
|
|||
* 'iface' if specified (if you want the interface to be selected,
|
||||
* automatically, this parameter should be NULL or an empty string).
|
||||
*/
|
||||
int owlps_create_socket_to_aggregator(char *dest_ip,
|
||||
int owlclient_create_socket_to_aggregator(char *dest_ip,
|
||||
uint_fast16_t dest_port,
|
||||
struct sockaddr_in *server,
|
||||
char *iface)
|
||||
|
@ -30,7 +30,7 @@ int owlps_create_socket_to_aggregator(char *dest_ip,
|
|||
|
||||
// If we specified an interface name
|
||||
if (iface != NULL && iface[0] != '\0')
|
||||
owlps_use_iface(sockfd, iface) ;
|
||||
owlclient_use_iface(sockfd, iface) ;
|
||||
|
||||
return sockfd ;
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ int owlps_create_socket_to_aggregator(char *dest_ip,
|
|||
|
||||
|
||||
/* Selects 'iface' as sending interface for the socket 'sockfd'. */
|
||||
void owlps_use_iface(int sockfd, char *iface)
|
||||
void owlclient_use_iface(int sockfd, char *iface)
|
||||
{
|
||||
if (setsockopt(sockfd, SOL_SOCKET, SO_BINDTODEVICE, iface,
|
||||
strlen(iface) + 1) == -1)
|
||||
|
@ -52,7 +52,7 @@ void owlps_use_iface(int sockfd, char *iface)
|
|||
|
||||
|
||||
|
||||
void owlps_send_request(int sockfd, struct sockaddr_in *server,
|
||||
void owlclient_send_request(int sockfd, struct sockaddr_in *server,
|
||||
void *packet, uint_fast16_t packet_size,
|
||||
uint_fast16_t nb_pkt, uint_fast32_t delay)
|
||||
{
|
||||
|
@ -63,13 +63,13 @@ void owlps_send_request(int sockfd, struct sockaddr_in *server,
|
|||
#endif // DEBUG
|
||||
|
||||
// Transmit first packet:
|
||||
owlps_send_packet(sockfd, server, packet, packet_size) ;
|
||||
owlclient_send_packet(sockfd, server, packet, packet_size) ;
|
||||
|
||||
// Transmit remaining packets (if any):
|
||||
for (i = 0 ; i < nb_pkt - 1 ; ++i)
|
||||
{
|
||||
usleep(delay) ; // Wait during the wanted delay
|
||||
owlps_send_packet(sockfd, server, packet, packet_size) ;
|
||||
owlclient_send_packet(sockfd, server, packet, packet_size) ;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
|
@ -79,7 +79,7 @@ void owlps_send_request(int sockfd, struct sockaddr_in *server,
|
|||
|
||||
|
||||
|
||||
void owlps_send_packet(int sockfd, struct sockaddr_in *server,
|
||||
void owlclient_send_packet(int sockfd, struct sockaddr_in *server,
|
||||
void *packet, uint_fast16_t packet_size)
|
||||
{
|
||||
ssize_t nsent = sendto(sockfd, packet, packet_size, 0,
|
||||
|
|
|
@ -14,15 +14,15 @@
|
|||
|
||||
|
||||
/* Function headers */
|
||||
int owlps_create_socket_to_aggregator(char *dest_ip,
|
||||
int owlclient_create_socket_to_aggregator(char *dest_ip,
|
||||
uint_fast16_t dest_port,
|
||||
struct sockaddr_in *server,
|
||||
char *iface) ;
|
||||
void owlps_use_iface(int sockfd, char *iface) ;
|
||||
void owlps_send_request(int sockfd, struct sockaddr_in *server,
|
||||
void owlclient_use_iface(int sockfd, char *iface) ;
|
||||
void owlclient_send_request(int sockfd, struct sockaddr_in *server,
|
||||
void *packet, uint_fast16_t packet_size,
|
||||
uint_fast16_t nb_pkt, uint_fast32_t delay) ;
|
||||
void owlps_send_packet(int sockfd, struct sockaddr_in *server,
|
||||
void owlclient_send_packet(int sockfd, struct sockaddr_in *server,
|
||||
void *packet, uint_fast16_t packet_size) ;
|
||||
|
||||
|
||||
|
|
|
@ -275,7 +275,8 @@ void print_configuration()
|
|||
void create_socket()
|
||||
{
|
||||
sockfd =
|
||||
owlps_create_socket_to_aggregator(options.dest_ip, options.dest_port,
|
||||
owlclient_create_socket_to_aggregator(options.dest_ip,
|
||||
options.dest_port,
|
||||
&server, options.iface) ;
|
||||
}
|
||||
|
||||
|
@ -330,7 +331,7 @@ void make_packet()
|
|||
|
||||
void send_request()
|
||||
{
|
||||
owlps_send_request(sockfd, &server, packet, packet_size,
|
||||
owlclient_send_request(sockfd, &server, packet, packet_size,
|
||||
options.nb_pkt, options.delay) ;
|
||||
}
|
||||
|
||||
|
|
|
@ -492,7 +492,7 @@ int capture()
|
|||
|
||||
/* Open UDP socket to the aggregator */
|
||||
aggregation_sockfd =
|
||||
owlps_create_socket_to_aggregator(GET_AGGREGATION_IP(),
|
||||
owlclient_create_socket_to_aggregator(GET_AGGREGATION_IP(),
|
||||
GET_AGGREGATION_PORT(),
|
||||
&aggregation_server, NULL) ;
|
||||
|
||||
|
@ -922,7 +922,7 @@ void autocalibrate_hello()
|
|||
fprintf(stderr, "Autocalibration Hello thread launched.\n") ;
|
||||
|
||||
send_sockfd =
|
||||
owlps_create_socket_to_aggregator(GET_AGGREGATION_IP(),
|
||||
owlclient_create_socket_to_aggregator(GET_AGGREGATION_IP(),
|
||||
GET_AUTOCALIBRATION_PORT(),
|
||||
&serv, NULL) ;
|
||||
|
||||
|
@ -930,7 +930,8 @@ void autocalibrate_hello()
|
|||
|
||||
while (run)
|
||||
{
|
||||
owlps_send_packet(send_sockfd, &serv, &message, sizeof(message)) ;
|
||||
owlclient_send_packet(send_sockfd, &serv,
|
||||
&message, sizeof(message)) ;
|
||||
sleep(GET_AUTOCALIBRATION_HELLO_DELAY()) ;
|
||||
}
|
||||
|
||||
|
@ -952,7 +953,7 @@ void autocalibrate()
|
|||
|
||||
// Socket to send autocalibration positioning requests
|
||||
autocalibration_send_sockfd =
|
||||
owlps_create_socket_to_aggregator(GET_AUTOCALIBRATION_IP(),
|
||||
owlclient_create_socket_to_aggregator(GET_AUTOCALIBRATION_IP(),
|
||||
GET_AUTOCALIBRATION_REQUEST_PORT(),
|
||||
&autocalibration_send_server,
|
||||
GET_WIFI_IFACE()) ;
|
||||
|
@ -1001,7 +1002,7 @@ void send_autocalibration_request()
|
|||
uint8_t *packet ;
|
||||
uint_fast16_t packet_size = make_packet(&packet) ;
|
||||
|
||||
owlps_send_request(autocalibration_send_sockfd,
|
||||
owlclient_send_request(autocalibration_send_sockfd,
|
||||
&autocalibration_send_server,
|
||||
packet, packet_size,
|
||||
GET_AUTOCALIBRATION_NBPKT(),
|
||||
|
|
Loading…
Reference in New Issue