Browse Source

seas: added guards to several include files

- bits of formating and removal of inline history

(cherry picked from commit e04716f4f9325fa5290555823132455ea599daac)
Daniel-Constantin Mierla 8 years ago
parent
commit
0dd00c1aed

+ 3 - 4
src/modules/seas/cluster.h

@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * Copyright (C) 2006-2007 VozTelecom Sistemas S.L
  *
  * This file is part of Kamailio, a free SIP server.
@@ -14,8 +13,8 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License 
- * along with this program; if not, write to the Free Software 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 

+ 6 - 4
src/modules/seas/encode_allow.h

@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * Copyright (C) 2006-2007 VozTelecom Sistemas S.L
  *
  * This file is part of Kamailio, a free SIP server.
@@ -14,11 +13,14 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License 
- * along with this program; if not, write to the Free Software 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
 
+#ifndef __ENCODE_ALLOW_H__
+#define __ENCODE_ALLOW_H__
 int encode_allow(char *hdrstart,int hdrlen,unsigned int *bodi,char *where);
 int print_encoded_allow(FILE *fd,char *hdr,int hdrlen,unsigned char* payload,int paylen,char *prefix);
+#endif

+ 6 - 4
src/modules/seas/encode_content_disposition.h

@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * Copyright (C) 2006-2007 VozTelecom Sistemas S.L
  *
  * This file is part of Kamailio, a free SIP server.
@@ -14,11 +13,14 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License 
- * along with this program; if not, write to the Free Software 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
 
+#ifndef __ENCODE_CONTENT_DISPOSITION_H__
+#define __ENCODE_CONTENT_DISPOSITION_H__
 int encode_content_disposition(char *hdrstart,int hdrlen,struct disposition *body,unsigned char *where);
 int print_encoded_content_disposition(FILE *fd,char *hdr,int hdrlen,unsigned char* payload,int paylen,char *prefix);
+#endif

+ 6 - 5
src/modules/seas/encode_content_length.h

@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * Copyright (C) 2006-2007 VozTelecom Sistemas S.L
  *
  * This file is part of Kamailio, a free SIP server.
@@ -14,11 +13,13 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License 
- * along with this program; if not, write to the Free Software 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-
+#ifndef __ENCODE_CONTENT_LENGHT_H__
+#define __ENCODE_CONTENT_LENGHT_H__
 int encode_contentlength(char *hdr,int hdrlen,long int len,char *where);
 int print_encoded_contentlength(FILE* fd,char *hdr,int hdrlen,unsigned char *payload,int paylen,char *prefix);
+#endif

+ 6 - 5
src/modules/seas/encode_content_type.h

@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * Copyright (C) 2006-2007 VozTelecom Sistemas S.L
  *
  * This file is part of Kamailio, a free SIP server.
@@ -14,15 +13,17 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License 
- * along with this program; if not, write to the Free Software 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-
+#ifndef __ENCODE_CONTENT_TYPE_H__
+#define __ENCODE_CONTENT_TYPE_H__
 int encode_content_type(char *hdrstart,int hdrlen,unsigned int bodi,char *where);
 int encode_accept(char *hdrstart,int hdrlen,unsigned int *bodi,char *where);
 int encode_mime_type(char *hdrstart,int hdrlen,unsigned int bodi,char *where);
 int print_encoded_mime_type(FILE* fd,char *hdr,int hdrlen,unsigned int* payload,int paylen,char *prefix);
 int print_encoded_content_type(FILE* fd,char *hdr,int hdrlen,unsigned char* payload,int paylen,char *prefix);
 int print_encoded_accept(FILE* fd,char *hdr,int hdrlen,unsigned char* payload,int paylen,char *prefix);
+#endif

+ 6 - 5
src/modules/seas/encode_cseq.h

@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * Copyright (C) 2006-2007 VozTelecom Sistemas S.L
  *
  * This file is part of Kamailio, a free SIP server.
@@ -14,13 +13,15 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License 
- * along with this program; if not, write to the Free Software 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-
+#ifndef __ENCODE_CSEQ_H__
+#define __ENCODE_CSEQ_H__
 #include "../../core/str.h"
 #include "../../core/parser/msg_parser.h"
 int encode_cseq(char *hdrstart,int hdrlen,struct cseq_body *body,unsigned char *where);
 int print_encoded_cseq(FILE* fd,char *hdr,int hdrlen,unsigned char* payload,int paylen,char *prefix);
+#endif

+ 6 - 5
src/modules/seas/encode_digest.h

@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * Copyright (C) 2006-2007 VozTelecom Sistemas S.L
  *
  * This file is part of Kamailio, a free SIP server.
@@ -14,12 +13,14 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License 
- * along with this program; if not, write to the Free Software 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-
+#ifndef __ENCODE_DIGEST_H__
+#define __ENCODE_DIGEST_H__
 int encode_digest(char *hdrstart,int hdrlen,dig_cred_t *digest,unsigned char *where);
 int print_encoded_digest(FILE* fd,char *hdr,int hdrlen,unsigned char* payload,int paylen,char *prefix);
 int dump_digest_test(char *hdr,int hdrlen,unsigned char* payload,int paylen,FILE* fd,char segregationLevel);
+#endif

File diff suppressed because it is too large
+ 514 - 515
src/modules/seas/seas.c


+ 53 - 54
src/modules/seas/seas.h

@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * Copyright (C) 2006-2007 VozTelecom Sistemas S.L
  *
  * This file is part of Kamailio, a free SIP server.
@@ -14,8 +13,8 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License 
- * along with this program; if not, write to the Free Software 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
@@ -67,9 +66,9 @@
 #define SPIRAL_FLAG 0x00000001
 
 #define net2hostL(dst,from,index) do{ \
-   memcpy(&(dst),(from)+(index),4); \
-   dst=ntohl(dst); \
-   (index)+=4; \
+	memcpy(&(dst),(from)+(index),4); \
+	dst=ntohl(dst); \
+	(index)+=4; \
 }while(0);
 
 
@@ -94,32 +93,32 @@ extern int servlet_pings_lost;
 extern struct as_entry *as_table;
 
 struct seas_functions{
-   struct tm_binds tmb;
-   cmd_function t_check_orig_trans;
+	struct tm_binds tmb;
+	cmd_function t_check_orig_trans;
 };
 
 /*TODO listen_points should be dynamically allocated ?*/
 typedef struct app_server {
-   int event_fd;
-   int action_fd;
-   str name;
-   pid_t action_pid;
-   struct socket_info *binds[MAX_BINDS];
-   char bound_processor[MAX_BINDS];
-   int num_binds;
-   str ev_buffer;
-   str ac_buffer;
-   struct ha jain_pings;
-   struct ha servlet_pings;
-   struct cluster *cluster;
+	int event_fd;
+	int action_fd;
+	str name;
+	pid_t action_pid;
+	struct socket_info *binds[MAX_BINDS];
+	char bound_processor[MAX_BINDS];
+	int num_binds;
+	str ev_buffer;
+	str ac_buffer;
+	struct ha jain_pings;
+	struct ha servlet_pings;
+	struct cluster *cluster;
 }as_t, *as_p;
 
 struct cluster{
-   str name;
-   int num;
-   int registered;
-   str as_names[MAX_AS_PER_CLUSTER];
-   as_p servers[MAX_AS_PER_CLUSTER];
+	str name;
+	int num;
+	int registered;
+	str as_names[MAX_AS_PER_CLUSTER];
+	as_p servers[MAX_AS_PER_CLUSTER];
 };
 
 /**
@@ -127,32 +126,32 @@ struct cluster{
  * when one matches, they will put the as pointer inside the event that should process
  * that event.
  * If eventually the as becomes unavailable, the dispatcher will set valid=false, which should be
- * atomic operation. This way, we prevent having to put a mutex on the array, which would make 
+ * atomic operation. This way, we prevent having to put a mutex on the array, which would make
  * it slower , as only one process could be accessing it at a time.
  */
 struct as_entry{
-   str name;
-   int type;
-   int connected;
-   union{
-      struct app_server as;
-      struct cluster cs;
-   }u;
-   struct as_entry *next;
+	str name;
+	int type;
+	int connected;
+	union{
+		struct app_server as;
+		struct cluster cs;
+	}u;
+	struct as_entry *next;
 };
 
 
 extern struct as_entry *my_as;
-extern struct seas_functions seas_f; 
+extern struct seas_functions seas_f;
 extern struct as_entry *as_list;
 
 typedef struct as_msg {
-   struct cell *transaction;
-   char *msg;
-   int len;
-   int type;
-   int id;
-   struct as_entry *as;
+	struct cell *transaction;
+	char *msg;
+	int len;
+	int type;
+	int id;
+	struct as_entry *as;
 }as_msg_t,*as_msg_p;
 
 char get_processor_id(struct receive_info *rcv,as_p as);
@@ -162,17 +161,17 @@ char* create_as_event_sl(struct sip_msg *msg,char processor_id,int *evt_len,int
 
 static inline void print_ip_buf(struct ip_addr* ip, char *where,int len)
 {
-   switch(ip->af){
-      case AF_INET:
-	 snprintf(where,len,"%d.%d.%d.%d", ip->u.addr[0], ip->u.addr[1], ip->u.addr[2], ip->u.addr[3]);
-	 break;
-      case AF_INET6:
-	 snprintf(where,len,"%x:%x:%x:%x:%x:%x:%x:%x",htons(ip->u.addr16[0]),htons(ip->u.addr16[1]),htons(ip->u.addr16[2]),
-	       htons(ip->u.addr16[3]), htons(ip->u.addr16[4]), htons(ip->u.addr16[5]), htons(ip->u.addr16[6]),
-	       htons(ip->u.addr16[7]));
-	 break;
-      default:
-	 break;
-   }
+	switch(ip->af){
+		case AF_INET:
+			snprintf(where,len,"%d.%d.%d.%d", ip->u.addr[0], ip->u.addr[1], ip->u.addr[2], ip->u.addr[3]);
+			break;
+		case AF_INET6:
+			snprintf(where,len,"%x:%x:%x:%x:%x:%x:%x:%x",htons(ip->u.addr16[0]),htons(ip->u.addr16[1]),htons(ip->u.addr16[2]),
+					htons(ip->u.addr16[3]), htons(ip->u.addr16[4]), htons(ip->u.addr16[5]), htons(ip->u.addr16[6]),
+					htons(ip->u.addr16[7]));
+			break;
+		default:
+			break;
+	}
 }
 #endif

+ 7 - 13
src/modules/seas/seas_action.c

@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * Copyright (C) 2006-2007 VozTelecom Sistemas S.L
  *
  * This file is part of Kamailio, a free SIP server.
@@ -14,15 +13,10 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License 
- * along with this program; if not, write to the Free Software 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  *
- * History:
- * -------
- * 2008-04-04 added support for local and remote dispaly name in TM dialogs
- *            (by Andrei Pisau <andrei at voice-system dot ro> )
- *
  */
 
 #include <unistd.h>
@@ -496,7 +490,7 @@ int ac_cancel(as_p the_as,unsigned char processor_id,unsigned int flags,char *ac
    the_param->uac_id=uac_id;
    the_param->processor_id=processor_id;
    the_param->destroy_cb_set=0;
-   
+
    /* registers TMCB_RESPONSE_IN|TMCB_LOCAL_COMPLETED tm callbacks */
    ret=seas_f.tmb.t_cancel_uac(&headers,&body,cancelled_hashIdx,cancelled_label,uac_cb,(void*)the_param);
    if (ret == 0) {
@@ -901,15 +895,15 @@ int forward_sl_request(struct sip_msg *msg,str *uri,int proto)
         if ((uri2dst(NULL,&dst, msg,  uri, proto)==0) || (dst.send_sock==0))
 #else
         if ((uri2dst(&dst, msg,  uri, proto)==0) || (dst.send_sock==0))
-#endif 
+#endif
         {
-		LOG(L_ERR, "forward_sl_request: no socket found\n");
+		LM_ERR("no socket found\n");
 		return -1;
 	}
 
         LM_DBG("Sending:\n%.*s.\n", (int)msg->len,msg->buf);
         if (msg_send(&dst, msg->buf,msg->len)<0){
-           LM_ERR("ERROR:seas:forward_sl_request: Error sending message !!\n");
+           LM_ERR("Error sending message !!\n");
            return -1;
         }
 	return ret;

Some files were not shown because too many files changed in this diff