[pisa-src] r1211 - in trunk/community-operator: hipl.c hipl.h

  • From: Jan Marten <jan.marten@xxxxxxxxxxxxxx>
  • To: pisa-src@xxxxxxxxxxxxx
  • Date: Fri, 16 Oct 2009 10:37:27 +0200

Author: marten
Date: Fri Oct 16 10:37:27 2009
New Revision: 1211

Log:
Added changes to HIPL calls in ifdef blocks which depend on HIPL changes.

Modified:
   trunk/community-operator/hipl.c
   trunk/community-operator/hipl.h

Modified: trunk/community-operator/hipl.c
==============================================================================
--- trunk/community-operator/hipl.c     Thu Oct 15 23:21:11 2009        (r1210)
+++ trunk/community-operator/hipl.c     Fri Oct 16 10:37:27 2009        (r1211)
@@ -14,9 +14,15 @@
 #include <string.h>
 #include <netinet/in.h>
 
+#ifndef HIPL_CERTIFICATE_CHANGES
 int createCertificate(time_t *not_before, time_t *not_after,
                      struct in6_addr *hit, struct in6_addr *issuer_hit,
                      char *certificate, size_t size)
+#else
+int createCertificate(time_t *not_before, time_t *not_after,
+                     struct in6_addr *hit, struct in6_addr *issuer_hit,
+                     int parallel_users, char *certificate, size_t size)
+#endif /* HIPL_CERTIFICATE_CHANGES */
 {
 #ifdef CONFIG_PISA_WITH_HIPL
        struct hip_cert_spki_info cert = { 0 };
@@ -26,8 +32,13 @@
                return -1;
        }
 
+#ifndef HIPL_CERTIFICATE_CHANGES
        hip_cert_spki_create_cert(&cert, "hit", issuer_hit, "hit", hit,
                                  not_before, not_after);
+#else
+       hip_cert_spki_create_cert(&cert, "hit", issuer_hit, "hit", hit,
+                                 not_before, not_after, parallel_users);
+#endif /* HIPL_CERTIFICATE_CHANGES */
 
        snprintf(certificate, size, "(sequence %s%s%s)", cert.public_key,
                 cert.cert, cert.signature);

Modified: trunk/community-operator/hipl.h
==============================================================================
--- trunk/community-operator/hipl.h     Thu Oct 15 23:21:11 2009        (r1210)
+++ trunk/community-operator/hipl.h     Fri Oct 16 10:37:27 2009        (r1211)
@@ -10,6 +10,7 @@
 #include <string.h>
 #include <netinet/in.h>
 
+#ifndef HIPL_CERTIFICATE_CHANGES
 /**
  * Create the certificate with the given parameters. This is a wrapper
  * function for hip_cert_spki_create_cert. It requires a running hipd on
@@ -26,6 +27,25 @@
 int createCertificate(time_t *not_before, time_t *not_after,
                      struct in6_addr *hit, struct in6_addr *issuer_hit,
                      char *certificate, size_t size);
+#else
+/**
+ * Create the certificate with the given parameters. This is a wrapper
+ * function for hip_cert_spki_create_cert. It requires a running hipd on
+ * the same machine and superuser privileges.
+ *
+ * @param not_before start of certificate lifetime
+ * @param not_after end of certificate lifetime
+ * @param hit HIT of subject (the home router HIT)
+ * @param issuer_hit HIT of issuer (the community operator HIT)
+ * @param certificate buffer to store the resulting certificate in
+ * @param size size of the certificate buffer
+ * @param parallel_users The number of allowed parallel users
+ * @return 0 on success
+ */
+int createCertificate(time_t *not_before, time_t *not_after,
+                     struct in6_addr *hit, struct in6_addr *issuer_hit,
+                     int parallel_users, char *certificate, size_t size);
+#endif /* HIPL_CERTIFICATE_CHANGES */
 
 /**
  * Get the default hit of the local HIPD. Requires a running hipd on the same

Other related posts:

  • » [pisa-src] r1211 - in trunk/community-operator: hipl.c hipl.h - Jan Marten