r2748 - in trunk/src/target/gsm: include/gsmd src/util

laforge at sita.openmoko.org laforge at sita.openmoko.org
Mon Aug 20 17:53:52 CEST 2007


Author: laforge
Date: 2007-08-20 17:53:47 +0200 (Mon, 20 Aug 2007)
New Revision: 2748

Modified:
   trunk/src/target/gsm/include/gsmd/usock.h
   trunk/src/target/gsm/src/util/shell.c
Log:
remove 'struct llist_head' from phonebook messages because
* pointer in data structures passed along sockets is a bad idea, if that socket
  is later a network socket and the pointer size of both ends is different
* we cannot include linux_list.h into libgsmd, since libgsmd is LGPL and
  linux_list.h GPL licensed

libgsmd and gsmd are actually not using that list header, only the shell
program is effected massively.  I hope somebody will clean up after me.  At
least this now should solve the issue with non-compiling libgsmd users (such as
libmokogsmd).


Modified: trunk/src/target/gsm/include/gsmd/usock.h
===================================================================
--- trunk/src/target/gsm/include/gsmd/usock.h	2007-08-20 13:40:31 UTC (rev 2747)
+++ trunk/src/target/gsm/include/gsmd/usock.h	2007-08-20 15:53:47 UTC (rev 2748)
@@ -2,7 +2,6 @@
 #define _GSMD_USOCK_H
 
 #include <gsmd/event.h>
-#include <common/linux_list.h>
 
 #define GSMD_UNIX_SOCKET "\0gsmd"
 //#define GSMD_UNIX_SOCKET_TYPE SOCK_SEQPACKET
@@ -426,7 +425,6 @@
 #define	GSMD_PB_NUMB_MAXLEN	44
 #define GSMD_PB_TEXT_MAXLEN	14
 struct gsmd_phonebook {
-	struct llist_head list;
 	u_int8_t index;
 	char numb[GSMD_PB_NUMB_MAXLEN+1];
 	u_int8_t type;
@@ -474,7 +472,6 @@
 };
 
 struct gsmd_phonebook_storage {
-	struct llist_head list;
 	char storage[3];
 } __attribute__ ((packed));
 
@@ -510,6 +507,7 @@
 
 #include <gsmd/usock.h>
 #include <gsmd/gsmd.h>
+#include <common/linux_list.h>
 
 struct gsmd_user;
 

Modified: trunk/src/target/gsm/src/util/shell.c
===================================================================
--- trunk/src/target/gsm/src/util/shell.c	2007-08-20 13:40:31 UTC (rev 2747)
+++ trunk/src/target/gsm/src/util/shell.c	2007-08-20 15:53:47 UTC (rev 2748)
@@ -34,6 +34,8 @@
 #include <gsmd/usock.h>
 #include <gsmd/ts0705.h>
 
+#include <common/linux_list.h>
+
 #ifndef __GSMD__
 #define __GSMD__
 #include <gsmd/talloc.h>
@@ -63,6 +65,7 @@
 	char buf[128];
 
 	switch (gmh->msg_subtype) {
+#if 0
 	case GSMD_PHONEBOOK_FIND:		
 	case GSMD_PHONEBOOK_READRG:
 		payload = (char *)gmh + sizeof(*gmh);
@@ -98,6 +101,7 @@
 		else
 			printf("%s\n", payload);
 		break;
+#endif
 	case GSMD_PHONEBOOK_READ:
 		gp = (struct gsmd_phonebook *) ((char *)gmh + sizeof(*gmh));
 		if (gp->index)
@@ -111,6 +115,7 @@
 		gps = (struct gsmd_phonebook_support *) ((char *)gmh + sizeof(*gmh));
 		printf("(1-%d), %d, %d\n", gps->index, gps->nlength, gps->tlength);
 		break;
+#if 0
 	case GSMD_PHONEBOOK_LIST_STORAGE:
 		payload = (char *)gmh + sizeof(*gmh);
 
@@ -151,6 +156,7 @@
 		else
 			printf("%s\n", payload);
 		break;
+#endif
 	case GSMD_PHONEBOOK_WRITE:
 	case GSMD_PHONEBOOK_DELETE:
 	case GSMD_PHONEBOOK_SET_STORAGE:
@@ -503,6 +509,7 @@
 				printf("Delete Phonebook Entry\n");				
 				ptr = strchr(buf, '=');
 				lgsm_pb_del_entry(lgsmh, atoi(ptr+1));
+#if 0
 			} else if ( !strncmp(buf, "prr", 3)) {	
 				printf("Read Phonebook Entries\n");
 				struct lgsm_phonebook_readrg pb_readrg;
@@ -524,9 +531,11 @@
 				ptr = strchr(buf, ',');
 				pb_readrg.index2 = atoi(ptr+1);
 				lgsm_pb_read_entries(lgsmh, &pb_readrg);
+#endif
 			} else if ( !strncmp(buf, "pr", 2)) {
 				ptr = strchr(buf, '=');
 				lgsm_pb_read_entry(lgsmh, atoi(ptr+1));
+#if 0
 			} else if ( !strncmp(buf, "pf", 2)) {
 				printf("Find Phonebook Entry\n");
 				struct lgsm_phonebook_find pb_find;
@@ -550,6 +559,7 @@
 				pb_find.findtext[strlen(ptr+1)] = '\0';	
 			
 				lgsm_pb_find_entry(lgsmh, &pb_find);
+#endif
 			} else if ( !strncmp(buf, "pw", 2)) {
 				printf("Write Phonebook Entry\n");
 				struct lgsm_phonebook pb;





More information about the commitlog mailing list