extern int nfnl_log_test_uid(const struct nfnl_log *);
extern uint32_t nfnl_log_get_uid(const struct nfnl_log *);
+extern void nfnl_log_set_gid(struct nfnl_log *, uint32_t);
+extern int nfnl_log_test_gid(const struct nfnl_log *);
+extern uint32_t nfnl_log_get_gid(const struct nfnl_log *);
+
extern void nfnl_log_set_seq(struct nfnl_log *, uint32_t);
extern int nfnl_log_test_seq(const struct nfnl_log *);
extern uint32_t nfnl_log_get_seq(const struct nfnl_log *);
//[NFULA_PAYLOAD]
[NFULA_PREFIX] = { .type = NLA_STRING, },
[NFULA_UID] = { .type = NLA_U32 },
+ [NFULA_GID] = { .type = NLA_U32 },
[NFULA_SEQ] = { .type = NLA_U32 },
[NFULA_SEQ_GLOBAL] = { .type = NLA_U32 },
};
if (attr)
nfnl_log_set_uid(log, ntohl(nla_get_u32(attr)));
+ attr = tb[NFULA_GID];
+ if (attr)
+ nfnl_log_set_gid(log, ntohl(nla_get_u32(attr)));
+
attr = tb[NFULA_SEQ];
if (attr)
nfnl_log_set_seq(log, ntohl(nla_get_u32(attr)));
#define LOG_ATTR_PAYLOAD (1UL << 10)
#define LOG_ATTR_PREFIX (1UL << 11)
#define LOG_ATTR_UID (1UL << 12)
-#define LOG_ATTR_SEQ (1UL << 13)
-#define LOG_ATTR_SEQ_GLOBAL (1UL << 14)
+#define LOG_ATTR_GID (1UL << 13)
+#define LOG_ATTR_SEQ (1UL << 14)
+#define LOG_ATTR_SEQ_GLOBAL (1UL << 15)
/** @endcond */
static void log_free_data(struct nl_object *c)
if (log->ce_mask & LOG_ATTR_PAYLOAD)
dp_dump(p, "PAYLOADLEN=%d ", log->log_payload_len);
+ if (log->ce_mask & LOG_ATTR_UID)
+ dp_dump(p, "UID=%u ", log->log_uid);
+
+ if (log->ce_mask & LOG_ATTR_GID)
+ dp_dump(p, "GID=%u ", log->log_gid);
+
if (log->ce_mask & LOG_ATTR_SEQ)
dp_dump(p, "SEQ=%d ", log->log_seq);
return log->log_uid;
}
+void nfnl_log_set_gid(struct nfnl_log *log, uint32_t gid)
+{
+ log->log_gid = gid;
+ log->ce_mask |= LOG_ATTR_GID;
+}
+
+int nfnl_log_test_gid(const struct nfnl_log *log)
+{
+ return !!(log->ce_mask & LOG_ATTR_GID);
+}
+
+uint32_t nfnl_log_get_gid(const struct nfnl_log *log)
+{
+ return log->log_gid;
+}
+
+
void nfnl_log_set_seq(struct nfnl_log *log, uint32_t seq)
{
log->log_seq = seq;