Move common helpers and functions into crda.h
authorLuis R. Rodriguez <lrodriguez@atheros.com>
Tue, 28 Oct 2008 00:06:21 +0000 (17:06 -0700)
committerLuis R. Rodriguez <lrodriguez@atheros.com>
Tue, 28 Oct 2008 00:06:21 +0000 (17:06 -0700)
We keep regdb.h clean specifically for file regdb data structures.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
crda.c
dump.c
regdb.h

diff --git a/crda.c b/crda.c
index 5b0e80f..681ff73 100644 (file)
--- a/crda.c
+++ b/crda.c
@@ -20,6 +20,7 @@
 #include <linux/nl80211.h>
 
 #include "regdb.h"
+#include "crda.h"
 
 struct nl80211_state {
        struct nl_handle *nl_handle;
@@ -94,27 +95,6 @@ static int error_handler(struct sockaddr_nl __attribute__((unused)) *nla,
        exit(err->error);
 }
 
-int isalpha_upper(char letter)
-{
-       if (letter >= 'A' && letter <= 'Z')
-               return 1;
-       return 0;
-}
-
-static int is_alpha2(const char *alpha2)
-{
-       if (isalpha_upper(alpha2[0]) && isalpha_upper(alpha2[1]))
-               return 1;
-       return 0;
-}
-
-static int is_world_regdom(const char *alpha2)
-{
-       if (alpha2[0] == '0' && alpha2[1] == '0')
-               return 1;
-       return 0;
-}
-
 static int is_valid_regdom(const char *alpha2)
 {
        if (strlen(alpha2) != 2)
@@ -126,6 +106,7 @@ static int is_valid_regdom(const char *alpha2)
        return 1;
 }
 
+
 static int put_reg_rule(__u8 *db, int dblen, __be32 ruleptr, struct nl_msg *msg)
 {
        struct regdb_file_reg_rule *rule;
diff --git a/dump.c b/dump.c
index b78581a..2bd9bc8 100644 (file)
--- a/dump.c
+++ b/dump.c
@@ -7,6 +7,7 @@
 #include <arpa/inet.h> /* ntohl */
 
 #include "regdb.h"
+#include "crda.h"
 
 static void print_reg_rule(__u8 *db, int dblen, __be32 ruleptr)
 {
diff --git a/regdb.h b/regdb.h
index 773139f..09cc403 100644 (file)
--- a/regdb.h
+++ b/regdb.h
@@ -100,11 +100,6 @@ struct regdb_file_reg_country {
 };
 
 
-/* functions */
-void *crda_get_file_ptr(__u8 *db, int dblen, int structlen, __be32 ptr);
-int crda_verify_db_signature(__u8 *db, int dblen, int siglen);
-
-
 /*
  * Verify that no unexpected padding is added to structures
  * for some reason.