Index: extensions/app_radgw/md5.c
===================================================================
--- extensions/app_radgw/md5.c	(revision 254)
+++ extensions/app_radgw/md5.c	(revision 403)
@@ -7,6 +7,4 @@
  */
 #include "rgw_common.h"
-/* Forward declaration: */
-void md5_vector(size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac);
 /*********************************************************************************/
 
Index: extensions/app_radgw/md5.h
===================================================================
--- extensions/app_radgw/md5.h	(revision 254)
+++ extensions/app_radgw/md5.h	(revision 403)
@@ -4,6 +4,6 @@
  * It is redistributed under the terms of the BSD license, as allowed
  * by the original copyright reproduced bellow.
- *  The file has not been modified, except for this notice.
  */
+
 /*********************************************************************************/
 
@@ -41,3 +41,6 @@
 #endif /* CONFIG_CRYPTO_INTERNAL */
 
+ /* Forward declaration: */
+void md5_vector(size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac);
+
 #endif /* MD5_H */
Index: extensions/app_radgw/rgw.h
===================================================================
--- extensions/app_radgw/rgw.h	(revision 356)
+++ extensions/app_radgw/rgw.h	(revision 403)
@@ -102,6 +102,4 @@
 int rgw_clients_check_dup(struct rgw_radius_msg_meta **msg, struct rgw_client *cli);
 int rgw_clients_check_origin(struct rgw_radius_msg_meta *msg, struct rgw_client *cli);
-int rgw_clients_get_origin(struct rgw_client *cli, char **fqdn, char **realm);
-char * rgw_clients_id(struct rgw_client *cli);
 int rgw_client_finish_send(struct radius_msg ** msg, struct rgw_radius_msg_meta * req, struct rgw_client * cli);
 void rgw_clients_dispose(struct rgw_client ** ref);
Index: extensions/app_radgw/rgw_clients.c
===================================================================
--- extensions/app_radgw/rgw_clients.c	(revision 395)
+++ extensions/app_radgw/rgw_clients.c	(revision 403)
@@ -189,5 +189,4 @@
 static int client_search(struct rgw_client ** res, struct sockaddr * ip_port )
 {
-	int ret = 0;
 	int cmp;
 	struct fd_list *ref = NULL;
@@ -301,5 +300,4 @@
 	for (idx = 0; idx < msg->radius.attr_used; idx++) {
 		struct radius_attr_hdr * attr = (struct radius_attr_hdr *)(msg->radius.buf + msg->radius.attr_pos[idx]);
-		unsigned char * attr_val = (unsigned char *)(attr + 1);
 		size_t attr_len = attr->length - sizeof(struct radius_attr_hdr);
 		
Index: extensions/app_radgw/rgw_common.h
===================================================================
--- extensions/app_radgw/rgw_common.h	(revision 356)
+++ extensions/app_radgw/rgw_common.h	(revision 403)
@@ -56,6 +56,8 @@
 /* This structure points to a RADIUS client description, the definition is not known to plugins */
 struct rgw_client;
-/* This function is required to be able to translate user paswords */
-int rgw_clients_getkey(struct rgw_client * cli, unsigned char **key, size_t *key_len);
+
+int    rgw_clients_getkey(struct rgw_client * cli, unsigned char **key, size_t *key_len);
+char * rgw_clients_id(struct rgw_client *cli);
+int    rgw_clients_get_origin(struct rgw_client *cli, char **fqdn, char **realm);
 
 /* Each plugin must provide the following structure. */
Index: extensions/app_radgw/rgw_conf.l
===================================================================
--- extensions/app_radgw/rgw_conf.l	(revision 258)
+++ extensions/app_radgw/rgw_conf.l	(revision 403)
@@ -136,5 +136,5 @@
 				}
 				
-				if (port = strchr(work, '[')) {
+				if ((port = strchr(work, '[')) != NULL) {
 					*port = '\0';
 					port++;
Index: extensions/app_radgw/rgw_plugins.c
===================================================================
--- extensions/app_radgw/rgw_plugins.c	(revision 356)
+++ extensions/app_radgw/rgw_plugins.c	(revision 403)
@@ -173,5 +173,4 @@
 {
 	struct plg_descr * new;
-	int ret = 0;
 	
 	TRACE_ENTRY("%p %p %d %p %zi", plgfile, conffile, type, codes_array, codes_sz);
Index: extensions/app_radgw/rgw_worker.c
===================================================================
--- extensions/app_radgw/rgw_worker.c	(revision 385)
+++ extensions/app_radgw/rgw_worker.c	(revision 403)
@@ -63,6 +63,4 @@
 static void * work_th(void * arg)
 {
-	char thname[10];
-	
 	TRACE_ENTRY("%p", arg);
 	
Index: extensions/app_radgw/rgwx_acct.c
===================================================================
--- extensions/app_radgw/rgwx_acct.c	(revision 376)
+++ extensions/app_radgw/rgwx_acct.c	(revision 403)
@@ -301,7 +301,7 @@
 	const char * prefix = "Diameter/";
 	size_t pref_len;
-	char * si = NULL;
+	uint8_t * si = NULL;
 	size_t si_len = 0;
-	char * un = NULL;
+	uint8_t * un = NULL;
 	size_t un_len = 0;
 	
@@ -357,5 +357,5 @@
 				if ((attr_len > pref_len ) && ! strncmp((char *)v, prefix, pref_len)) {
 					int i;
-					si = (char *)v + pref_len;
+					si = v + pref_len;
 					si_len = attr_len - pref_len;
 					TRACE_DEBUG(ANNOYING, "Found Class attribute with '%s' prefix (attr #%d), SI:'%.*s'.", prefix, idx, si_len, si);
@@ -369,5 +369,5 @@
 			case RADIUS_ATTR_USER_NAME:
 				if (attr_len) {
-					un = (char *)v;
+					un = v;
 					un_len = attr_len;
 					TRACE_DEBUG(ANNOYING, "Found a User-Name attribute: '%.*s'", un_len, un);
@@ -471,5 +471,5 @@
 	if (idx == 0) {
 		/* Not found in the User-Name => we use the local domain of this gateway */
-		value.os.data = fd_g_config->cnf_diamrlm;
+		value.os.data = (uint8_t *)fd_g_config->cnf_diamrlm;
 		value.os.len  = fd_g_config->cnf_diamrlm_len;
 	} else {
@@ -482,5 +482,5 @@
 	/* Create the Session-Id AVP if needed */
 	if (!*session) {
-		CHECK_FCT( fd_sess_fromsid ( si, si_len, session, NULL) );
+		CHECK_FCT( fd_sess_fromsid ( (char *)/* cast should be removed later */si, si_len, session, NULL) );
 		
 		TRACE_DEBUG(FULL, "[auth.rgwx] Translating new accounting message for session '%.*s'...", si_len, si);
Index: extensions/app_radgw/rgwx_auth.c
===================================================================
--- extensions/app_radgw/rgwx_auth.c	(revision 388)
+++ extensions/app_radgw/rgwx_auth.c	(revision 403)
@@ -236,13 +236,12 @@
 	const char * prefix = "Diameter/";
 	size_t pref_len;
-	char * dh = NULL;
+	uint8_t * dh = NULL;
 	size_t dh_len = 0;
-	char * dr = NULL;
+	uint8_t * dr = NULL;
 	size_t dr_len = 0;
-	char * si = NULL;
+	uint8_t * si = NULL;
 	size_t si_len = 0;
-	char * un = NULL;
+	uint8_t * un = NULL;
 	size_t un_len = 0;
-	uint32_t status_type;
 	size_t nattr_used = 0;
 	struct avp ** avp_tun = NULL, *avp = NULL;
@@ -316,5 +315,5 @@
 	for (idx = 0; idx < rad_req->attr_used; idx++) {
 		struct radius_attr_hdr * attr = (struct radius_attr_hdr *)(rad_req->buf + rad_req->attr_pos[idx]);
-		char * attr_val = (char *)(attr + 1);
+		uint8_t * attr_val = (uint8_t *)(attr + 1);
 		size_t attr_len = attr->length - sizeof(struct radius_attr_hdr);
 		
@@ -343,5 +342,5 @@
 			case RADIUS_ATTR_STATE:
 				if ((attr_len > pref_len + 5 /* for the '/'s and non empty strings */ ) 
-					&& ! strncmp(attr_val, prefix, pref_len)) { /* should we make it strncasecmp? */
+					&& ! memcmp(attr_val, prefix, pref_len)) {
 					int i, start;
 
@@ -376,5 +375,5 @@
 		
 			case RADIUS_ATTR_USER_NAME:
-				TRACE_DEBUG(ANNOYING, "Found a User-Name attribute: '%.*s'", attr_len, attr_len ? attr_val : "");
+				TRACE_DEBUG(ANNOYING, "Found a User-Name attribute: '%.*s'", attr_len, attr_len ? (char *)attr_val : "");
 				un = attr_val;
 				un_len = attr_len;
@@ -430,5 +429,5 @@
 		if (i <= 0) {
 			/* Not found in the User-Name => we use the local domain of this gateway */
-			value.os.data = fd_g_config->cnf_diamrlm;
+			value.os.data = (uint8_t *)fd_g_config->cnf_diamrlm;
 			value.os.len  = fd_g_config->cnf_diamrlm_len;
 		} else {
@@ -455,5 +454,5 @@
 		if (si_len) {
 			/* We already have the Session-Id, just use it */
-			CHECK_FCT( fd_sess_fromsid ( si, si_len, session, NULL) );
+			CHECK_FCT( fd_sess_fromsid ( (char *) /* this cast will be removed later */ si, si_len, session, NULL) );
 		} else {
 			/* Create a new Session-Id string */
@@ -544,5 +543,5 @@
 		if (got_empty_eap) {
 			value.os.len = 0;
-			value.os.data = "";
+			value.os.data = (uint8_t *)"";
 		} else {
 			CHECK_MALLOC( value.os.data = radius_msg_get_eap(rad_req, &value.os.len) );
@@ -1066,5 +1065,6 @@
 	struct avp *avp, *next, *avp_x, *avp_y, *asid, *aoh;
 	struct avp_hdr *ahdr, *sid, *oh;
-	char buf[254]; /* to store some attributes values (with final '\0') */
+	uint8_t buf[254]; /* to store some attributes values (with final '\0') */
+	size_t sz;
 	int ta_set = 0;
 	int no_str = 0; /* indicate if an STR is required for this server */
@@ -1189,20 +1189,20 @@
 	/* Now, save the session-id and eventually server info in a STATE or CLASS attribute */
 	if ((*rad_fw)->hdr->code == RADIUS_CODE_ACCESS_CHALLENGE) {
-		if (sizeof(buf) < snprintf(buf, sizeof(buf), "Diameter/%.*s/%.*s/%.*s", 
-				oh->avp_value->os.len,  oh->avp_value->os.data,
-				ahdr->avp_value->os.len,  ahdr->avp_value->os.data,
-				sid->avp_value->os.len, sid->avp_value->os.data)) {
+		if (sizeof(buf) < (sz = snprintf((char *)buf, sizeof(buf), "Diameter/%.*s/%.*s/%.*s", 
+				oh->avp_value->os.len,  (char *)oh->avp_value->os.data,
+				ahdr->avp_value->os.len,  (char *)ahdr->avp_value->os.data,
+				sid->avp_value->os.len, (char *)sid->avp_value->os.data))) {
 			TRACE_DEBUG(INFO, "Data truncated in State attribute: %s", buf);
 		}
-		CONV2RAD_STR(RADIUS_ATTR_STATE, buf, strlen(buf), 0);
+		CONV2RAD_STR(RADIUS_ATTR_STATE, buf, sz, 0);
 	}
 
 	if ((*rad_fw)->hdr->code == RADIUS_CODE_ACCESS_ACCEPT) {
 		/* Add the Session-Id */
-		if (sizeof(buf) < snprintf(buf, sizeof(buf), "Diameter/%.*s", 
-				sid->avp_value->os.len, sid->avp_value->os.data)) {
+		if (sizeof(buf) < (sz = snprintf((char *)buf, sizeof(buf), "Diameter/%.*s", 
+				sid->avp_value->os.len, sid->avp_value->os.data))) {
 			TRACE_DEBUG(INFO, "Data truncated in Class attribute: %s", buf);
 		}
-		CONV2RAD_STR(RADIUS_ATTR_CLASS, buf, strlen(buf), 0);
+		CONV2RAD_STR(RADIUS_ATTR_CLASS, buf, sz, 0);
 	}
 	
@@ -1587,5 +1587,5 @@
 							CHECK_FCT( fd_msg_avp_hdr ( inavp, &ahdr ) );
 							
-							if (ahdr->avp_flags & AVP_FLAG_VENDOR == 0) {
+							if ( ! (ahdr->avp_flags & AVP_FLAG_VENDOR)) {
 								switch (ahdr->avp_code) {
 									case DIAM_ATTR_TUNNEL_TYPE:
@@ -1634,5 +1634,4 @@
 											size_t pos;
 											int i;
-											size_t buflen;
 											uint8_t * secret;	/* S */
 											size_t secret_len;
@@ -1653,5 +1652,5 @@
 											
 											/* The plain text string P */
-											CHECK_PARAM(ahdr->avp_value->os.len < 240);
+											CHECK_PARAMS(ahdr->avp_value->os.len < 240);
 											buf[3] = ahdr->avp_value->os.len;
 											memcpy(&buf[4], ahdr->avp_value->os.data, ahdr->avp_value->os.len);
@@ -1817,9 +1816,9 @@
 		/* Add the auth-application-id required for STR, or 0 if no STR is required */
 		CHECK_FCT( fd_msg_hdr( *diam_ans, &hdr ) );
-		if (sizeof(buf) < snprintf(buf, sizeof(buf), CLASS_AAI_PREFIX "%u", 
-				no_str ? 0 : hdr->msg_appl)) {
+		if (sizeof(buf) < (sz = snprintf((char *)buf, sizeof(buf), CLASS_AAI_PREFIX "%u", 
+				no_str ? 0 : hdr->msg_appl))) {
 			TRACE_DEBUG(INFO, "Data truncated in Class attribute: %s", buf);
 		}
-		CONV2RAD_STR(RADIUS_ATTR_CLASS, buf, strlen(buf), 0);
+		CONV2RAD_STR(RADIUS_ATTR_CLASS, buf, sz, 0);
 	}
 	
Index: extensions/app_radgw/rgwx_echodrop.c
===================================================================
--- extensions/app_radgw/rgwx_echodrop.c	(revision 356)
+++ extensions/app_radgw/rgwx_echodrop.c	(revision 403)
@@ -240,5 +240,4 @@
 static int ed_diam_ans( struct rgwp_config * cs, struct session * session, struct msg ** diam_ans, struct radius_msg ** rad_fw, struct rgw_client * cli, int * stateful )
 {
-	int ret;
 	struct fd_list * list = NULL;
 	
@@ -265,5 +264,4 @@
 	while (! FD_IS_LIST_EMPTY(list) ) {
 		struct ed_saved_attribute * esa = (struct ed_saved_attribute *)(list->next);
-		struct radius_attr_hdr * rc;
 		
 		fd_list_unlink(&esa->chain);
Index: extensions/app_radgw/rgwx_echodrop.y
===================================================================
--- extensions/app_radgw/rgwx_echodrop.y	(revision 270)
+++ extensions/app_radgw/rgwx_echodrop.y	(revision 403)
@@ -53,4 +53,12 @@
 #include "rgwx_echodrop.h"
 #include "rgwx_echodrop.tab.h"	/* bison is not smart enough to define the YYLTYPE before including this code, so... */
+
+
+/* Forward declaration */
+int yyparse(char * conffile, struct rgwp_config *cs);
+
+/* The Lex parser prototype */
+int rgwx_echodroplex(YYSTYPE *lvalp, YYLTYPE *llocp);
+
 
 /* Parse the configuration file */
