mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-ggsn.git
synced 2025-10-23 08:22:07 +00:00
Fix various compiler warnings throughout the code
Mostly signed/unsigned and typecasting issues Taken from http://sourceforge.net/tracker/index.php?func=detail&aid=1811517&group_id=68956&atid=522957
This commit is contained in:
@@ -124,7 +124,7 @@ int daemon(int nochdir, int noclose) {
|
||||
|
||||
int encaps_printf(void *p, void *packet, unsigned len)
|
||||
{
|
||||
int i;
|
||||
unsigned int i;
|
||||
if (debug) {
|
||||
printf("The packet looks like this:\n");
|
||||
for( i=0; i<len; i++) {
|
||||
@@ -423,7 +423,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
apn.l = strlen(args_info.apn_arg) + 1;
|
||||
apn.v[0] = (char) strlen(args_info.apn_arg);
|
||||
strncpy(&apn.v[1], args_info.apn_arg, sizeof(apn.v)-1);
|
||||
strncpy((char *) &apn.v[1], args_info.apn_arg, sizeof(apn.v)-1);
|
||||
|
||||
|
||||
/* foreground */
|
||||
|
@@ -23,7 +23,7 @@
|
||||
|
||||
|
||||
int ippool_printaddr(struct ippool_t *this) {
|
||||
int n;
|
||||
unsigned int n;
|
||||
printf("ippool_printaddr\n");
|
||||
printf("Firstdyn %d\n", this->firstdyn - this->member);
|
||||
printf("Lastdyn %d\n", this->lastdyn - this->member);
|
||||
@@ -110,7 +110,7 @@ int ippool_aton(struct in_addr *addr, struct in_addr *mask,
|
||||
unsigned int a1, a2, a3, a4;
|
||||
unsigned int m1, m2, m3, m4;
|
||||
int c;
|
||||
unsigned int m;
|
||||
int m;
|
||||
int masklog;
|
||||
|
||||
c = sscanf(pool, "%u.%u.%u.%u/%u.%u.%u.%u",
|
||||
@@ -167,8 +167,8 @@ int ippool_new(struct ippool_t **this, char *dyn, char *stat,
|
||||
struct in_addr stataddr;
|
||||
struct in_addr statmask;
|
||||
unsigned int m;
|
||||
unsigned int listsize;
|
||||
unsigned int dynsize;
|
||||
int listsize;
|
||||
int dynsize;
|
||||
unsigned int statsize;
|
||||
|
||||
if (!allowdyn) {
|
||||
|
@@ -37,13 +37,13 @@
|
||||
struct ippoolm_t; /* Forward declaration */
|
||||
|
||||
struct ippool_t {
|
||||
int listsize; /* Total number of addresses */
|
||||
unsigned int listsize; /* Total number of addresses */
|
||||
int allowdyn; /* Allow dynamic IP address allocation */
|
||||
int allowstat; /* Allow static IP address allocation */
|
||||
struct in_addr stataddr; /* Static address range network address */
|
||||
struct in_addr statmask; /* Static address range network mask */
|
||||
struct ippoolm_t *member; /* Listsize array of members */
|
||||
int hashsize; /* Size of hash table */
|
||||
unsigned int hashsize; /* Size of hash table */
|
||||
int hashlog; /* Log2 size of hash table */
|
||||
int hashmask; /* Bitmask for calculating hash */
|
||||
struct ippoolm_t **hash; /* Hashsize array of pointer to member */
|
||||
|
@@ -41,7 +41,7 @@ void sys_errpack(int pri, char *fn, int ln, int en, struct sockaddr_in *peer,
|
||||
va_list args;
|
||||
char buf[SYSERR_MSGSIZE];
|
||||
char buf2[SYSERR_MSGSIZE];
|
||||
int n;
|
||||
unsigned int n;
|
||||
int pos;
|
||||
|
||||
va_start(args, fmt);
|
||||
|
@@ -243,7 +243,7 @@ int tun_addaddr(struct tun_t *this,
|
||||
} req;
|
||||
|
||||
struct sockaddr_nl local;
|
||||
int addr_len;
|
||||
socklen_t addr_len;
|
||||
int fd;
|
||||
int status;
|
||||
|
||||
|
36
gtp/gtp.c
36
gtp/gtp.c
@@ -72,7 +72,7 @@ void gtp_errpack(int pri, char *fn, int ln, struct sockaddr_in *peer,
|
||||
va_list args;
|
||||
char buf[ERRMSG_SIZE];
|
||||
char buf2[ERRMSG_SIZE];
|
||||
int n;
|
||||
unsigned int n;
|
||||
int pos;
|
||||
|
||||
va_start(args, fmt);
|
||||
@@ -177,7 +177,7 @@ extern int gtp_set_cb_data_ind(struct gsn_t *gsn,
|
||||
* to hold the packet header.
|
||||
* returns the length of the header. 0 on error.
|
||||
**/
|
||||
static int get_default_gtp(int version, uint8_t type, void *packet) {
|
||||
static unsigned int get_default_gtp(int version, uint8_t type, void *packet) {
|
||||
struct gtp0_header *gtp0_default = (struct gtp0_header*) packet;
|
||||
struct gtp1_header_long *gtp1_default = (struct gtp1_header_long*) packet;
|
||||
switch (version) {
|
||||
@@ -286,7 +286,7 @@ static uint32_t get_tei(void *pack) {
|
||||
|
||||
int print_packet(void *packet, unsigned len)
|
||||
{
|
||||
int i;
|
||||
unsigned int i;
|
||||
printf("The packet looks like this (%d bytes):\n", len);
|
||||
for( i=0; i<len; i++) {
|
||||
printf("%02x ", (unsigned char)*(char *)(packet+i));
|
||||
@@ -298,7 +298,7 @@ int print_packet(void *packet, unsigned len)
|
||||
|
||||
char* snprint_packet(struct gsn_t *gsn, struct sockaddr_in *peer,
|
||||
void *pack, unsigned len, char *buf, int size) {
|
||||
int n;
|
||||
unsigned int n;
|
||||
int pos;
|
||||
snprintf(buf, size, "Packet from %s:%u, length: %d, content:",
|
||||
inet_ntoa(peer->sin_addr),
|
||||
@@ -867,7 +867,7 @@ int gtp_echo_req(struct gsn_t *gsn, int version, void *cbp,
|
||||
struct in_addr *inetaddr)
|
||||
{
|
||||
union gtp_packet packet;
|
||||
int length = get_default_gtp(version, GTP_ECHO_REQ, &packet);
|
||||
unsigned int length = get_default_gtp(version, GTP_ECHO_REQ, &packet);
|
||||
return gtp_req(gsn, version, NULL, &packet, length, inetaddr, cbp);
|
||||
}
|
||||
|
||||
@@ -877,7 +877,7 @@ int gtp_echo_resp(struct gsn_t *gsn, int version,
|
||||
void *pack, unsigned len)
|
||||
{
|
||||
union gtp_packet packet;
|
||||
int length = get_default_gtp(version, GTP_ECHO_RSP, &packet);
|
||||
unsigned int length = get_default_gtp(version, GTP_ECHO_RSP, &packet);
|
||||
gtpie_tv1(&packet, &length, GTP_MAX, GTPIE_RECOVERY, gsn->restart_counter);
|
||||
return gtp_resp(version, gsn, NULL, &packet, length, peer, fd,
|
||||
get_seq(pack), get_tid(pack));
|
||||
@@ -948,7 +948,7 @@ int gtp_unsup_req(struct gsn_t *gsn, int version, struct sockaddr_in *peer,
|
||||
union gtp_packet packet;
|
||||
|
||||
/* GTP 1 is the highest supported protocol */
|
||||
int length = get_default_gtp(1, GTP_NOT_SUPPORTED, &packet);
|
||||
unsigned int length = get_default_gtp(1, GTP_NOT_SUPPORTED, &packet);
|
||||
return gtp_notification(gsn, version, &packet, length,
|
||||
peer, fd, 0);
|
||||
}
|
||||
@@ -967,7 +967,7 @@ int gtp_extheader_req(struct gsn_t *gsn, int version, struct sockaddr_in *peer,
|
||||
int fd, void *pack, unsigned len)
|
||||
{
|
||||
union gtp_packet packet;
|
||||
int length = get_default_gtp(version, GTP_SUPP_EXT_HEADER, &packet);
|
||||
unsigned int length = get_default_gtp(version, GTP_SUPP_EXT_HEADER, &packet);
|
||||
|
||||
uint8_t pdcp_pdu = GTP_EXT_PDCP_PDU;
|
||||
|
||||
@@ -1008,7 +1008,7 @@ int gtp_extheader_ind(struct gsn_t *gsn, struct sockaddr_in *peer,
|
||||
extern int gtp_create_context_req(struct gsn_t *gsn, struct pdp_t *pdp,
|
||||
void *cbp) {
|
||||
union gtp_packet packet;
|
||||
int length = get_default_gtp(pdp->version, GTP_CREATE_PDP_REQ, &packet);
|
||||
unsigned int length = get_default_gtp(pdp->version, GTP_CREATE_PDP_REQ, &packet);
|
||||
struct pdp_t *linked_pdp = NULL;
|
||||
|
||||
/* TODO: Secondary PDP Context Activation Procedure */
|
||||
@@ -1147,7 +1147,7 @@ int gtp_set_cb_create_context_ind(struct gsn_t *gsn,
|
||||
int gtp_create_pdp_resp(struct gsn_t *gsn, int version, struct pdp_t *pdp,
|
||||
uint8_t cause) {
|
||||
union gtp_packet packet;
|
||||
int length = get_default_gtp(version, GTP_CREATE_PDP_RSP, &packet);
|
||||
unsigned int length = get_default_gtp(version, GTP_CREATE_PDP_RSP, &packet);
|
||||
|
||||
gtpie_tv1(&packet, &length, GTP_MAX, GTPIE_CAUSE, cause);
|
||||
|
||||
@@ -1726,7 +1726,7 @@ int gtp_create_pdp_conf(struct gsn_t *gsn, int version,
|
||||
int gtp_update_context(struct gsn_t *gsn, struct pdp_t *pdp, void *cbp,
|
||||
struct in_addr* inetaddr) {
|
||||
union gtp_packet packet;
|
||||
int length = get_default_gtp(pdp->version, GTP_UPDATE_PDP_REQ, &packet);
|
||||
unsigned int length = get_default_gtp(pdp->version, GTP_UPDATE_PDP_REQ, &packet);
|
||||
|
||||
if (pdp->version == 0)
|
||||
gtpie_tv0(&packet, &length, GTP_MAX, GTPIE_QOS_PROFILE0,
|
||||
@@ -1805,7 +1805,7 @@ int gtp_update_pdp_resp(struct gsn_t *gsn, int version,
|
||||
struct pdp_t *pdp, uint8_t cause) {
|
||||
|
||||
union gtp_packet packet;
|
||||
int length = get_default_gtp(version, GTP_CREATE_PDP_RSP, &packet);
|
||||
unsigned int length = get_default_gtp(version, GTP_CREATE_PDP_RSP, &packet);
|
||||
|
||||
gtpie_tv1(&packet, &length, GTP_MAX, GTPIE_CAUSE, cause);
|
||||
|
||||
@@ -2181,7 +2181,7 @@ int gtp_update_pdp_conf(struct gsn_t *gsn, int version,
|
||||
int gtp_delete_context_req(struct gsn_t *gsn, struct pdp_t *pdp, void *cbp,
|
||||
int teardown) {
|
||||
union gtp_packet packet;
|
||||
int length = get_default_gtp(pdp->version, GTP_DELETE_PDP_REQ, &packet);
|
||||
unsigned int length = get_default_gtp(pdp->version, GTP_DELETE_PDP_REQ, &packet);
|
||||
struct in_addr addr;
|
||||
struct pdp_t *linked_pdp;
|
||||
struct pdp_t *secondary_pdp;
|
||||
@@ -2258,7 +2258,7 @@ int gtp_delete_pdp_resp(struct gsn_t *gsn, int version,
|
||||
{
|
||||
union gtp_packet packet;
|
||||
struct pdp_t *secondary_pdp;
|
||||
int length = get_default_gtp(version, GTP_DELETE_PDP_RSP, &packet);
|
||||
unsigned int length = get_default_gtp(version, GTP_DELETE_PDP_RSP, &packet);
|
||||
int n;
|
||||
|
||||
gtpie_tv1(&packet, &length, GTP_MAX, GTPIE_CAUSE, cause);
|
||||
@@ -2432,7 +2432,7 @@ int gtp_error_ind_resp(struct gsn_t *gsn, int version,
|
||||
void *pack, unsigned len)
|
||||
{
|
||||
union gtp_packet packet;
|
||||
int length = get_default_gtp(version, GTP_ERROR, &packet);
|
||||
unsigned int length = get_default_gtp(version, GTP_ERROR, &packet);
|
||||
|
||||
return gtp_resp(version, gsn, NULL, &packet, length, peer, fd,
|
||||
get_seq(pack), get_tid(pack));
|
||||
@@ -2524,7 +2524,7 @@ int gtp_decaps0(struct gsn_t *gsn)
|
||||
{
|
||||
unsigned char buffer[PACKET_MAX];
|
||||
struct sockaddr_in peer;
|
||||
int peerlen;
|
||||
size_t peerlen;
|
||||
int status;
|
||||
struct gtp0_header *pheader;
|
||||
int version = 0; /* GTP version should be determined from header!*/
|
||||
@@ -2656,7 +2656,7 @@ int gtp_decaps1c(struct gsn_t *gsn)
|
||||
{
|
||||
unsigned char buffer[PACKET_MAX];
|
||||
struct sockaddr_in peer;
|
||||
int peerlen;
|
||||
size_t peerlen;
|
||||
int status;
|
||||
struct gtp1_header_short *pheader;
|
||||
int version = 1; /* TODO GTP version should be determined from header!*/
|
||||
@@ -2815,7 +2815,7 @@ int gtp_decaps1u(struct gsn_t *gsn)
|
||||
{
|
||||
unsigned char buffer[PACKET_MAX];
|
||||
struct sockaddr_in peer;
|
||||
int peerlen;
|
||||
size_t peerlen;
|
||||
int status;
|
||||
struct gtp1_header_short *pheader;
|
||||
int version = 1; /* GTP version should be determined from header!*/
|
||||
|
20
gtp/gtpie.c
20
gtp/gtpie.c
@@ -39,7 +39,7 @@
|
||||
|
||||
#include "gtpie.h"
|
||||
|
||||
int gtpie_tlv(void *p, int *length, int size, uint8_t t, int l, void *v) {
|
||||
int gtpie_tlv(void *p, unsigned int *length, unsigned int size, uint8_t t, int l, void *v) {
|
||||
if ((*length + 3 + l) >= size) return 1;
|
||||
((union gtpie_member*) (p + *length))->tlv.t = hton8(t);
|
||||
((union gtpie_member*) (p + *length))->tlv.l = hton16(l);
|
||||
@@ -48,7 +48,7 @@ int gtpie_tlv(void *p, int *length, int size, uint8_t t, int l, void *v) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int gtpie_tv0(void *p, int *length, int size, uint8_t t, int l, uint8_t *v) {
|
||||
int gtpie_tv0(void *p, unsigned int *length, unsigned int size, uint8_t t, int l, uint8_t *v) {
|
||||
if ((*length + 1 + l) >= size) return 1;
|
||||
((union gtpie_member*) (p + *length))->tv0.t = hton8(t);
|
||||
memcpy((void*) (p + *length +1), v, l);
|
||||
@@ -56,7 +56,7 @@ int gtpie_tv0(void *p, int *length, int size, uint8_t t, int l, uint8_t *v) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int gtpie_tv1(void *p, int *length, int size, uint8_t t, uint8_t v) {
|
||||
int gtpie_tv1(void *p, unsigned int *length, unsigned int size, uint8_t t, uint8_t v) {
|
||||
if ((*length + 2) >= size) return 1;
|
||||
((union gtpie_member*) (p + *length))->tv1.t = hton8(t);
|
||||
((union gtpie_member*) (p + *length))->tv1.v = hton8(v);
|
||||
@@ -64,7 +64,7 @@ int gtpie_tv1(void *p, int *length, int size, uint8_t t, uint8_t v) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int gtpie_tv2(void *p, int *length, int size, uint8_t t, uint16_t v) {
|
||||
int gtpie_tv2(void *p, unsigned int *length, unsigned int size, uint8_t t, uint16_t v) {
|
||||
if ((*length + 3) >= size) return 1;
|
||||
((union gtpie_member*) (p + *length))->tv2.t = hton8(t);
|
||||
((union gtpie_member*) (p + *length))->tv2.v = hton16(v);
|
||||
@@ -72,7 +72,7 @@ int gtpie_tv2(void *p, int *length, int size, uint8_t t, uint16_t v) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int gtpie_tv4(void *p, int *length, int size, uint8_t t, uint32_t v) {
|
||||
int gtpie_tv4(void *p, unsigned int *length, unsigned int size, uint8_t t, uint32_t v) {
|
||||
if ((*length + 5) >= size) return 1;
|
||||
((union gtpie_member*) (p + *length))->tv4.t = hton8(t);
|
||||
((union gtpie_member*) (p + *length))->tv4.v = hton32(v);
|
||||
@@ -80,7 +80,7 @@ int gtpie_tv4(void *p, int *length, int size, uint8_t t, uint32_t v) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int gtpie_tv8(void *p, int *length, int size, uint8_t t, uint64_t v) {
|
||||
int gtpie_tv8(void *p, unsigned int *length, unsigned int size, uint8_t t, uint64_t v) {
|
||||
if ((*length + 9) >= size) return 1;
|
||||
((union gtpie_member*) (p + *length))->tv8.t = hton8(t);
|
||||
((union gtpie_member*) (p + *length))->tv8.v = hton64(v);
|
||||
@@ -109,7 +109,7 @@ int gtpie_exist(union gtpie_member* ie[], int type, int instance) {
|
||||
}
|
||||
|
||||
int gtpie_gettlv(union gtpie_member* ie[], int type, int instance,
|
||||
int *length, void *dst, int size){
|
||||
unsigned int *length, void *dst, unsigned int size){
|
||||
int ien;
|
||||
ien = gtpie_getie(ie, type, instance);
|
||||
if (ien>=0) {
|
||||
@@ -123,7 +123,7 @@ int gtpie_gettlv(union gtpie_member* ie[], int type, int instance,
|
||||
}
|
||||
|
||||
int gtpie_gettv0(union gtpie_member* ie[], int type, int instance,
|
||||
void *dst, int size){
|
||||
void *dst, unsigned int size){
|
||||
int ien;
|
||||
ien = gtpie_getie(ie, type, instance);
|
||||
if (ien>=0)
|
||||
@@ -453,9 +453,9 @@ int gtpie_encaps(union gtpie_member *ie[], void *pack, unsigned *len) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int gtpie_encaps2(union gtpie_member ie[], int size,
|
||||
int gtpie_encaps2(union gtpie_member ie[], unsigned int size,
|
||||
void *pack, unsigned *len) {
|
||||
int i, j;
|
||||
unsigned int i, j;
|
||||
unsigned char *p;
|
||||
unsigned char *end;
|
||||
union gtpie_member *m;
|
||||
|
18
gtp/gtpie.h
18
gtp/gtpie.h
@@ -219,20 +219,20 @@ struct tlv2 {
|
||||
uint16_t length;
|
||||
}__attribute__((packed));
|
||||
|
||||
extern int gtpie_tlv(void *p, int *length, int size,
|
||||
extern int gtpie_tlv(void *p, unsigned int *length, unsigned int size,
|
||||
uint8_t t, int l, void *v);
|
||||
extern int gtpie_tv0(void *p, int *length, int size,
|
||||
extern int gtpie_tv0(void *p, unsigned int *length, unsigned int size,
|
||||
uint8_t t, int l, uint8_t *v);
|
||||
extern int gtpie_tv1(void *p, int *length, int size, uint8_t t, uint8_t v);
|
||||
extern int gtpie_tv2(void *p, int *length, int size, uint8_t t, uint16_t v);
|
||||
extern int gtpie_tv4(void *p, int *length, int size, uint8_t t, uint32_t v);
|
||||
extern int gtpie_tv8(void *p, int *length, int size, uint8_t t, uint64_t v);
|
||||
extern int gtpie_tv1(void *p, unsigned int *length, unsigned int size, uint8_t t, uint8_t v);
|
||||
extern int gtpie_tv2(void *p, unsigned int *length, unsigned int size, uint8_t t, uint16_t v);
|
||||
extern int gtpie_tv4(void *p, unsigned int *length, unsigned int size, uint8_t t, uint32_t v);
|
||||
extern int gtpie_tv8(void *p, unsigned int *length, unsigned int size, uint8_t t, uint64_t v);
|
||||
extern int gtpie_getie(union gtpie_member* ie[], int type, int instance);
|
||||
extern int gtpie_exist(union gtpie_member* ie[], int type, int instance);
|
||||
extern int gtpie_gettlv(union gtpie_member* ie[], int type, int instance,
|
||||
int *length, void *dst, int size);
|
||||
unsigned int *length, void *dst, unsigned int size);
|
||||
extern int gtpie_gettv0(union gtpie_member* ie[], int type, int instance,
|
||||
void *dst, int size);
|
||||
void *dst, unsigned int size);
|
||||
extern int gtpie_gettv1(union gtpie_member* ie[], int type, int instance,
|
||||
uint8_t *dst);
|
||||
extern int gtpie_gettv2(union gtpie_member* ie[], int type, int instance,
|
||||
@@ -245,7 +245,7 @@ extern int gtpie_gettv8(union gtpie_member* ie[], int type, int instance,
|
||||
extern int gtpie_decaps(union gtpie_member* ie[], int version,
|
||||
void *pack, unsigned len);
|
||||
extern int gtpie_encaps(union gtpie_member* ie[], void *pack, unsigned *len);
|
||||
extern int gtpie_encaps2(union gtpie_member ie[], int size,
|
||||
extern int gtpie_encaps2(union gtpie_member ie[], unsigned int size,
|
||||
void *pack, unsigned *len);
|
||||
|
||||
|
||||
|
10
gtp/pdp.h
10
gtp/pdp.h
@@ -23,27 +23,27 @@
|
||||
|
||||
|
||||
struct sl_t {
|
||||
int l;
|
||||
unsigned int l;
|
||||
char *v;
|
||||
};
|
||||
|
||||
struct ul_t {
|
||||
int l;
|
||||
unsigned int l;
|
||||
unsigned char *v;
|
||||
};
|
||||
|
||||
struct ul16_t {
|
||||
int l;
|
||||
unsigned int l;
|
||||
unsigned char v[16];
|
||||
};
|
||||
|
||||
struct ul66_t {
|
||||
int l;
|
||||
unsigned int l;
|
||||
unsigned char v[66];
|
||||
};
|
||||
|
||||
struct ul255_t {
|
||||
int l;
|
||||
unsigned int l;
|
||||
unsigned char v[255];
|
||||
};
|
||||
|
||||
|
@@ -40,8 +40,8 @@ option "ipup" - "Script to run after link-up" string no
|
||||
option "ipdown" - "Script to run after link-down" string no
|
||||
|
||||
option "pinghost" - "Ping remote host" string no
|
||||
option "pingrate" - "Number of ping req per second" int default="1" no
|
||||
option "pingsize" - "Number of ping data bytes" int default="56" no
|
||||
option "pingcount" - "Number of ping req to send" int default="0" no
|
||||
option "pingrate" - "Number of ping req per second" unsigned int default="1" no
|
||||
option "pingsize" - "Number of ping data bytes" unsigned int default="56" no
|
||||
option "pingcount" - "Number of ping req to send" unsigned int default="0" no
|
||||
option "pingquiet" - "Do not print ping packet info" flag off
|
||||
|
||||
|
@@ -45,9 +45,9 @@ struct gengetopt_args_info
|
||||
char * ipup_arg; /* Script to run after link-up. */
|
||||
char * ipdown_arg; /* Script to run after link-down. */
|
||||
char * pinghost_arg; /* Ping remote host. */
|
||||
int pingrate_arg; /* Number of ping req per second (default='1'). */
|
||||
int pingsize_arg; /* Number of ping data bytes (default='56'). */
|
||||
int pingcount_arg; /* Number of ping req to send (default='0'). */
|
||||
unsigned int pingrate_arg; /* Number of ping req per second (default='1'). */
|
||||
unsigned int pingsize_arg; /* Number of ping data bytes (default='56'). */
|
||||
unsigned int pingcount_arg; /* Number of ping req to send (default='0'). */
|
||||
int pingquiet_flag; /* Do not print ping packet info (default=off). */
|
||||
|
||||
int help_given ; /* Whether help was given. */
|
||||
|
@@ -23,7 +23,7 @@
|
||||
|
||||
|
||||
int ippool_printaddr(struct ippool_t *this) {
|
||||
int n;
|
||||
unsigned int n;
|
||||
printf("ippool_printaddr\n");
|
||||
printf("Firstdyn %d\n", this->firstdyn - this->member);
|
||||
printf("Lastdyn %d\n", this->lastdyn - this->member);
|
||||
@@ -110,7 +110,7 @@ int ippool_aton(struct in_addr *addr, struct in_addr *mask,
|
||||
unsigned int a1, a2, a3, a4;
|
||||
unsigned int m1, m2, m3, m4;
|
||||
int c;
|
||||
unsigned int m;
|
||||
int m;
|
||||
int masklog;
|
||||
|
||||
c = sscanf(pool, "%u.%u.%u.%u/%u.%u.%u.%u",
|
||||
@@ -167,8 +167,8 @@ int ippool_new(struct ippool_t **this, char *dyn, char *stat,
|
||||
struct in_addr stataddr;
|
||||
struct in_addr statmask;
|
||||
unsigned int m;
|
||||
unsigned int listsize;
|
||||
unsigned int dynsize;
|
||||
int listsize;
|
||||
int dynsize;
|
||||
unsigned int statsize;
|
||||
|
||||
if (!allowdyn) {
|
||||
|
@@ -37,13 +37,13 @@
|
||||
struct ippoolm_t; /* Forward declaration */
|
||||
|
||||
struct ippool_t {
|
||||
int listsize; /* Total number of addresses */
|
||||
unsigned int listsize; /* Total number of addresses */
|
||||
int allowdyn; /* Allow dynamic IP address allocation */
|
||||
int allowstat; /* Allow static IP address allocation */
|
||||
struct in_addr stataddr; /* Static address range network address */
|
||||
struct in_addr statmask; /* Static address range network mask */
|
||||
struct ippoolm_t *member; /* Listsize array of members */
|
||||
int hashsize; /* Size of hash table */
|
||||
unsigned int hashsize; /* Size of hash table */
|
||||
int hashlog; /* Log2 size of hash table */
|
||||
int hashmask; /* Bitmask for calculating hash */
|
||||
struct ippoolm_t **hash; /* Hashsize array of pointer to member */
|
||||
|
@@ -210,7 +210,7 @@ int process_options(int argc, char **argv) {
|
||||
struct gengetopt_args_info args_info;
|
||||
|
||||
struct hostent *host;
|
||||
int n;
|
||||
unsigned int n;
|
||||
|
||||
if (cmdline_parser (argc, argv, &args_info) != 0)
|
||||
return -1;
|
||||
@@ -560,7 +560,7 @@ int process_options(int argc, char **argv) {
|
||||
|
||||
|
||||
int encaps_printf(struct pdp_t *pdp, void *pack, unsigned len) {
|
||||
int i;
|
||||
unsigned int i;
|
||||
printf("The packet looks like this:\n");
|
||||
for( i=0; i<len; i++) {
|
||||
printf("%02x ", (unsigned char)*(char *)(pack+i));
|
||||
@@ -606,10 +606,10 @@ char * print_icmptype(int t) {
|
||||
}
|
||||
|
||||
int msisdn_add(struct ul16_t *src, struct ul16_t *dst, int add) {
|
||||
int n;
|
||||
unsigned int n;
|
||||
uint64_t i64 = 0;
|
||||
uint8_t msa[sizeof(i64) * 3]; /* Allocate 3 digits per octet (0..255) */
|
||||
int msalen = 0;
|
||||
unsigned int msalen = 0;
|
||||
|
||||
/* Convert to uint64_t from ul16_t format (most significant digit first) */
|
||||
/* ul16_t format always starts with 0x91 to indicate international format */
|
||||
@@ -805,13 +805,13 @@ int encaps_ping(struct pdp_t *pdp, void *pack, unsigned len) {
|
||||
|
||||
/* Create a new ping packet and send it off to peer. */
|
||||
int create_ping(void *gsn, struct pdp_t *pdp,
|
||||
struct in_addr *dst, int seq, int datasize) {
|
||||
struct in_addr *dst, int seq, unsigned int datasize) {
|
||||
|
||||
struct ip_ping pack;
|
||||
uint16_t *p = (uint16_t *) &pack;
|
||||
uint8_t *p8 = (uint8_t *) &pack;
|
||||
struct in_addr src;
|
||||
int n;
|
||||
unsigned int n;
|
||||
long int sum = 0;
|
||||
int count = 0;
|
||||
|
||||
|
@@ -41,7 +41,7 @@ void sys_errpack(int pri, char *fn, int ln, int en, struct sockaddr_in *peer,
|
||||
va_list args;
|
||||
char buf[SYSERR_MSGSIZE];
|
||||
char buf2[SYSERR_MSGSIZE];
|
||||
int n;
|
||||
unsigned int n;
|
||||
int pos;
|
||||
|
||||
va_start(args, fmt);
|
||||
|
@@ -243,7 +243,7 @@ int tun_addaddr(struct tun_t *this,
|
||||
} req;
|
||||
|
||||
struct sockaddr_nl local;
|
||||
int addr_len;
|
||||
socklen_t addr_len;
|
||||
int fd;
|
||||
int status;
|
||||
|
||||
|
Reference in New Issue
Block a user