FIXME: actually there are 2 different entities:
- internal feature number (when switching on/off a feature);
- the value to be packed to the buffer.
It is better to split them.
};
#undef X
+static enum syscall_id id_none[] = {};
+
static enum syscall_id id_file[] = {
id_sys_acct,
id_sys_mount,
}
static struct feature features[] = {
+ CREATE_FEATURE(id_none),
CREATE_FEATURE(id_file),
CREATE_FEATURE(id_ipc),
- CREATE_FEATURE(id_net),
CREATE_FEATURE(id_process),
CREATE_FEATURE(id_signal),
+ CREATE_FEATURE(id_net),
CREATE_FEATURE(id_desc)
};
static void set_spt(struct feature *f, size_t id)
{
- int num = f - features;
- ksp[id].pst = num + 1;
+ ksp[id].pst = f - features;
}
static int install_features(struct feature *f)
#define _KS_FEATURES_H
enum feature_id {
- FID_FILE,
- FID_IPC,
- FID_NET,
- FID_PROCESS,
- FID_SIGNAL,
- FID_DESC
+ FID_FILE = 1,
+ FID_IPC = 2,
+ FID_PROCESS = 3,
+ FID_SIGNAL = 4,
+ FID_NET = 5,
+ FID_DESC = 6
};
int set_feature(enum feature_id id);