Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 686820 Details for
Bug 887992
Audit messages should be available to the journal
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
Test app using libnl-3 calls
mulicast-listener.c (text/x-csrc), 1.53 KB, created by
Richard Guy Briggs
on 2013-01-24 14:57:57 UTC
(
hide
)
Description:
Test app using libnl-3 calls
Filename:
MIME Type:
Creator:
Richard Guy Briggs
Created:
2013-01-24 14:57:57 UTC
Size:
1.53 KB
patch
obsolete
>#include <netlink/netlink.h> >#include <netlink/socket.h> >#include <netlink/msg.h> >#include <stdio.h> >#define HAVE_LIBCAP_NG >#ifdef HAVE_LIBCAP_NG >#include <cap-ng.h> >#endif >#ifndef CAP_AUDIT_READ >#define CAP_AUDIT_READ 37 >#endif > >/* > * * This function will be called for each valid netlink message received > * * in nl_recvmsgs_default() > * */ >static int my_func(struct nl_msg *msg, void *arg) >{ > char *data; > struct nlmsghdr *nlh; > > arg = arg; //shut up gcc > > nlh = nlmsg_hdr(msg); > > data = NLMSG_DATA(nlh); > printf("%s\n", data); > return 0; >} > >int main(void) >{ > struct nl_sock *sk; > >#ifdef HAVE_LIBCAP_NG > /* Drop capabilities */ > capng_clear(CAPNG_SELECT_BOTH); > capng_update(CAPNG_ADD, > CAPNG_EFFECTIVE|CAPNG_PERMITTED|CAPNG_BOUNDING_SET, > CAP_AUDIT_READ); > capng_apply(CAPNG_SELECT_BOTH); >#endif > > /* Allocate a new socket */ > sk = nl_socket_alloc(); > > /* > * Notifications do not use sequence numbers, disable sequence number > * checking. > */ > nl_socket_disable_seq_check(sk); > > /* > * Define a callback function, which will be called for each notification > * received > */ > nl_socket_modify_cb(sk, NL_CB_VALID, NL_CB_CUSTOM, my_func, NULL); > > /* Connect to routing netlink protocol */ > nl_connect(sk, NETLINK_AUDIT); > > /* Subscribe to link notifications group */ > nl_socket_add_memberships(sk, 1, 0); > > /* > * Start receiving messages. The function nl_recvmsgs_default() will block > * until one or more netlink messages (notification) are received which > * will be passed on to my_func(). > */ > while (1) > nl_recvmsgs_default(sk); > > return 0; >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
rbriggs
: review?
Actions:
View
Attachments on
bug 887992
:
686259
|
686801
| 686820