[lib] Some translation & minor things
This commit is contained in:
parent
ac6998d798
commit
96fb99c951
|
@ -210,22 +210,22 @@ int iface_mode_monitor(char *iface)
|
||||||
struct iwreq wrq ;
|
struct iwreq wrq ;
|
||||||
int sockfd = iw_sockets_open() ;
|
int sockfd = iw_sockets_open() ;
|
||||||
|
|
||||||
|
|
||||||
strncpy((&wrq)->ifr_name, iface, IFNAMSIZ) ;
|
strncpy((&wrq)->ifr_name, iface, IFNAMSIZ) ;
|
||||||
|
|
||||||
if (ioctl(sockfd, SIOCGIWMODE, &wrq) == -1) // Récupération du mode actuel
|
if (ioctl(sockfd, SIOCGIWMODE, &wrq) == -1) // Get current mode
|
||||||
{
|
{
|
||||||
perror("Erreur lors de la lecture du mode ") ;
|
perror("Error reading interface mode") ;
|
||||||
return ERR_READING_MODE ;
|
return ERR_READING_MODE ;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wrq.u.mode != IW_MODE_MONITOR) // Si on n'est pas déjà en mode Monitor
|
// If interface is not yet in Monitor mode
|
||||||
|
if (wrq.u.mode != IW_MODE_MONITOR)
|
||||||
{
|
{
|
||||||
wrq.u.mode = IW_MODE_MONITOR ;
|
wrq.u.mode = IW_MODE_MONITOR ;
|
||||||
if (ioctl(sockfd, SIOCSIWMODE, &wrq) == -1) // on y passe.
|
if (ioctl(sockfd, SIOCSIWMODE, &wrq) == -1) // Set up Monitor mode
|
||||||
{
|
{
|
||||||
perror("Erreur lors du passage en mode Monitor ") ;
|
perror("Error setting up Monitor mode") ;
|
||||||
return ERR_SETTING_MONITOR_MODE ;
|
return ERR_SETTING_MODE ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
* This file is part of the rtap localisation project.
|
* This file is part of the rtap localisation project.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _LIB_RTAPUTIL_H
|
#ifndef _LIBOWLPS_H_
|
||||||
#define _LIB_RTAPUTIL_H
|
#define _LIBOWLPS_H_
|
||||||
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -36,10 +36,14 @@
|
||||||
#include <wireless.h>
|
#include <wireless.h>
|
||||||
|
|
||||||
|
|
||||||
#define LOC_REQUEST_DEFAULT_PORT 9900 // Port sur lequel est envoyée la requête de localisation depuis le mobile
|
// Port on which the positioning request is sent by the mobile:
|
||||||
#define AGGREGATE_DEFAULT_PORT 9901 // Port d'échange des données entre AP et serveur d'aggrégation
|
#define LOC_REQUEST_DEFAULT_PORT 9900
|
||||||
#define POSITIONER_DEFAULT_PORT 9902 // Port d'échange des données entre serveur d'aggrégation et serveur de localisation
|
// Port on which listeners and aggregator communicate:
|
||||||
#define MOBILE_DEFAULT_PORT 9903 // Port d'envoi de la solution vers le mobile
|
#define AGGREGATE_DEFAULT_PORT 9901
|
||||||
|
// Port on which aggregator and positioning server communicate:
|
||||||
|
#define POSITIONER_DEFAULT_PORT 9902
|
||||||
|
// Port on which the mobile listens for its position:
|
||||||
|
#define MOBILE_DEFAULT_PORT 9910
|
||||||
|
|
||||||
/* Type booléen */
|
/* Type booléen */
|
||||||
typedef enum {FALSE, TRUE} BOOL ;
|
typedef enum {FALSE, TRUE} BOOL ;
|
||||||
|
@ -71,7 +75,8 @@ typedef struct _couple_info
|
||||||
unsigned char antenna_signal_dbm ; // Puissance du signal reçu par l'AP
|
unsigned char antenna_signal_dbm ; // Puissance du signal reçu par l'AP
|
||||||
} couple_info ;
|
} couple_info ;
|
||||||
|
|
||||||
typedef struct _request{
|
typedef struct _request
|
||||||
|
{
|
||||||
unsigned char mobile_mac_addr_bytes[6]; //Adresse MAC du mobile
|
unsigned char mobile_mac_addr_bytes[6]; //Adresse MAC du mobile
|
||||||
struct timeval request_time; // Date sur le client
|
struct timeval request_time; // Date sur le client
|
||||||
int nb_couples; // Nombre couples (MAC AP;Puissance)
|
int nb_couples; // Nombre couples (MAC AP;Puissance)
|
||||||
|
@ -165,7 +170,7 @@ BOOL run ;
|
||||||
|
|
||||||
|
|
||||||
/* Codes d'erreur des fonctions */
|
/* Codes d'erreur des fonctions */
|
||||||
#define ERR_SETTING_MONITOR_MODE 101
|
#define ERR_SETTING_MODE 101
|
||||||
#define ERR_SETTING_CHANNEL 102
|
#define ERR_SETTING_CHANNEL 102
|
||||||
#define ERR_READING_CHANNEL 103
|
#define ERR_READING_CHANNEL 103
|
||||||
#define ERR_READING_MODE 104
|
#define ERR_READING_MODE 104
|
||||||
|
@ -200,4 +205,4 @@ void sigterm_handler(int num) ;
|
||||||
#define IS_RETRY(IEEE80211_FLAGS) ((IEEE80211_FLAGS) & 0x08)
|
#define IS_RETRY(IEEE80211_FLAGS) ((IEEE80211_FLAGS) & 0x08)
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif // _LIBOWLPS_H_
|
||||||
|
|
Loading…
Reference in New Issue