Only seed database for Debian install if we're using default config
[onak.git] / keystructs.h
index 33dba65a5b6d6c364ab8c2c12d28dfa691dacb9d..33c6226ed77cf925544c2af78ef763580a6a0b7b 100644 (file)
@@ -9,7 +9,11 @@
 #ifndef __KEYSTRUCTS_H__
 #define __KEYSTRUCTS_H__
 
+#include <inttypes.h>
 #include <stdbool.h>
+#include <stdlib.h>
+
+#include "ll.h"
 
 /**
  *     struct openpgp_packet - Stores an OpenPGP packet.
@@ -61,15 +65,17 @@ struct openpgp_signedpacket_list {
 /**
  *     struct openpgp_publickey - An OpenPGP public key complete with sigs.
  *     @publickey: The OpenPGP packet for the public key.
- *     @revocation: The OpenPGP packet for the revocation [optional]
+ *     @revoked: True if the key is revoked.
+ *     @sigs: Any signatures directly on the publickey packet.
  *     @uids: The list of UIDs with signatures for this key.
  *     @subkeys: The list of subkeys with signatures for this key.
  *     @next: The next public key.
  */
 struct openpgp_publickey {
        struct openpgp_packet                   *publickey;
-       struct openpgp_packet_list              *revocations;
-       struct openpgp_packet_list              *last_revocation;
+       bool                                     revoked;
+       struct openpgp_packet_list              *sigs;
+       struct openpgp_packet_list              *last_sig;
        struct openpgp_signedpacket_list        *uids;
        struct openpgp_signedpacket_list        *last_uid;
        struct openpgp_signedpacket_list        *subkeys;
@@ -77,4 +83,25 @@ struct openpgp_publickey {
        struct openpgp_publickey                *next;
 };
 
+/**
+ *     struct stats_key - holds key details suitable for doing stats on.
+ *     @keyid: The keyid.
+ *     @colour: Used for marking during DFS/BFS.
+ *     @parent: The key that lead us to this one for DFS/BFS.
+ *     @sigs: A linked list of the signatures on this key.
+ *     @gotsigs: A bool indicating if we've initialized the sigs element yet.
+ *     @disabled: If we shouldn't consider the key in calculations.
+ *     @revoked: If the key is revoked (and shouldn't be considered).
+ */
+struct stats_key {
+       uint64_t keyid;
+       int colour;
+       uint64_t parent;
+       struct ll *sigs;
+       struct ll *signs;
+       bool gotsigs;
+       bool disabled;
+       bool revoked;
+};
+
 #endif /* __KEYSTRUCTS_H__ */