-struct Capability captab[] = {
-/* name cap */
- { "QS", CAP_QS },
- { "EX", CAP_EX },
- { "CHW", CAP_CHW},
- { "IE", CAP_IE},
- { "KLN", CAP_KLN},
- { "KNOCK", CAP_KNOCK},
- { "ZIP", CAP_ZIP},
- { "TB", CAP_TB},
- { "UNKLN", CAP_UNKLN},
- { "CLUSTER", CAP_CLUSTER},
- { "ENCAP", CAP_ENCAP },
- { "SERVICES", CAP_SERVICE },
- { "RSFNC", CAP_RSFNC },
- { "SAVE", CAP_SAVE },
- { "EUID", CAP_EUID },
- { "EOPMOD", CAP_EOPMOD },
- {0, 0}
-};
+struct CapabilityIndex *serv_capindex = NULL;
+
+unsigned int CAP_CAP;
+unsigned int CAP_QS;
+unsigned int CAP_EX;
+unsigned int CAP_CHW;
+unsigned int CAP_IE;
+unsigned int CAP_KLN;
+unsigned int CAP_ZIP;
+unsigned int CAP_KNOCK;
+unsigned int CAP_TB;
+unsigned int CAP_UNKLN;
+unsigned int CAP_CLUSTER;
+unsigned int CAP_ENCAP;
+unsigned int CAP_TS6;
+unsigned int CAP_SERVICE;
+unsigned int CAP_RSFNC;
+unsigned int CAP_SAVE;
+unsigned int CAP_EUID;
+unsigned int CAP_EOPMOD;
+unsigned int CAP_BAN;
+unsigned int CAP_MLOCK;
+
+/*
+ * initialize our builtin capability table. --nenolod
+ */
+void
+init_builtin_capabs(void)
+{
+ serv_capindex = capability_index_create("server capabilities");
+
+ /* These two are not set via CAPAB/GCAP keywords. */
+ CAP_CAP = capability_put_anonymous(serv_capindex);
+ CAP_TS6 = capability_put_anonymous(serv_capindex);
+
+ CAP_QS = capability_put(serv_capindex, "QS");
+ CAP_EX = capability_put(serv_capindex, "EX");
+ CAP_CHW = capability_put(serv_capindex, "CHW");
+ CAP_IE = capability_put(serv_capindex, "IE");
+ CAP_KLN = capability_put(serv_capindex, "KLN");
+ CAP_KNOCK = capability_put(serv_capindex, "KNOCK");
+ CAP_ZIP = capability_put(serv_capindex, "ZIP");
+ CAP_TB = capability_put(serv_capindex, "TB");
+ CAP_UNKLN = capability_put(serv_capindex, "UNKLN");
+ CAP_CLUSTER = capability_put(serv_capindex, "CLUSTER");
+ CAP_ENCAP = capability_put(serv_capindex, "ENCAP");
+ CAP_SERVICE = capability_put(serv_capindex, "SERVICES");
+ CAP_RSFNC = capability_put(serv_capindex, "RSFNC");
+ CAP_SAVE = capability_put(serv_capindex, "SAVE");
+ CAP_EUID = capability_put(serv_capindex, "EUID");
+ CAP_EOPMOD = capability_put(serv_capindex, "EOPMOD");
+ CAP_BAN = capability_put(serv_capindex, "BAN");
+ CAP_MLOCK = capability_put(serv_capindex, "MLOCK");
+
+ capability_require(serv_capindex, "QS");
+ capability_require(serv_capindex, "EX");
+ capability_require(serv_capindex, "IE");
+ capability_require(serv_capindex, "ENCAP");
+}