summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author/C=EU/ST=EU/CN=Patrick McHardy/emailAddress=kaber@trash.net </C=EU/ST=EU/CN=Patrick McHardy/emailAddress=kaber@trash.net>2008-04-21 12:35:42 +0000
committer/C=EU/ST=EU/CN=Patrick McHardy/emailAddress=kaber@trash.net </C=EU/ST=EU/CN=Patrick McHardy/emailAddress=kaber@trash.net>2008-04-21 12:35:42 +0000
commitc9415a65a0227a538ca3c9c8067be94716894f14 (patch)
treeb2c059a6662c2a16d18217ea35c4c74fa877fdeb
parent6976bf8cb8dd1315778e0b353eb9f892590264d2 (diff)
Add NFULA_GID support
-rw-r--r--include/libnetfilter_log/libnetfilter_log.h1
-rw-r--r--include/libnetfilter_log/linux_nfnetlink_log.h1
-rw-r--r--src/libnetfilter_log.c9
3 files changed, 11 insertions, 0 deletions
diff --git a/include/libnetfilter_log/libnetfilter_log.h b/include/libnetfilter_log/libnetfilter_log.h
index 5615daf..4e5d763 100644
--- a/include/libnetfilter_log/libnetfilter_log.h
+++ b/include/libnetfilter_log/libnetfilter_log.h
@@ -58,6 +58,7 @@ extern struct nfulnl_msg_packet_hw *nflog_get_packet_hw(struct nflog_data *nfad)
extern int nflog_get_payload(struct nflog_data *nfad, char **data);
extern char *nflog_get_prefix(struct nflog_data *nfad);
extern int nflog_get_uid(struct nflog_data *nfad, u_int32_t *uid);
+extern int nflog_get_gid(struct nflog_data *nfad, u_int32_t *gid);
extern int nflog_get_seq(struct nflog_data *nfad, u_int32_t *seq);
extern int nflog_get_seq_global(struct nflog_data *nfad, u_int32_t *seq);
diff --git a/include/libnetfilter_log/linux_nfnetlink_log.h b/include/libnetfilter_log/linux_nfnetlink_log.h
index 12787e7..f8e174d 100644
--- a/include/libnetfilter_log/linux_nfnetlink_log.h
+++ b/include/libnetfilter_log/linux_nfnetlink_log.h
@@ -53,6 +53,7 @@ enum nfulnl_attr_type {
NFULA_UID, /* user id of socket */
NFULA_SEQ, /* instance-local sequence number */
NFULA_SEQ_GLOBAL, /* global sequence number */
+ NFULA_GID, /* group id of socket */
__NFULA_MAX
};
diff --git a/src/libnetfilter_log.c b/src/libnetfilter_log.c
index 95537d8..a3bd435 100644
--- a/src/libnetfilter_log.c
+++ b/src/libnetfilter_log.c
@@ -442,6 +442,15 @@ int nflog_get_uid(struct nflog_data *nfad, u_int32_t *uid)
return 0;
}
+int nflog_get_gid(struct nflog_data *nfad, u_int32_t *gid)
+{
+ if (!nfnl_attr_present(nfad->nfa, NFULA_GID))
+ return -1;
+
+ *gid = ntohl(nfnl_get_data(nfad->nfa, NFULA_GID, u_int32_t));
+ return 0;
+}
+
int nflog_get_seq(struct nflog_data *nfad, u_int32_t *seq)
{
if (!nfnl_attr_present(nfad->nfa, NFULA_SEQ))