2 * Copyright (c) 2016 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #include <linux/netlink.h>
19 #include <linux/genetlink.h>
20 #include <linux/rtnetlink.h>
24 #define NETLINK_BUF_SIZE 16536
41 char buf[NETLINK_BUF_SIZE];
44 struct netlink_serialization_params {
47 struct counter_arg *carg;
48 int (*eval_attr)(struct rtattr *attr_list[__NFACCT_MAX],
50 int (*post_eval_attr)(void *user_data);
54 void (*deserialize_answer)(struct netlink_serialization_params *params);
55 void (*finalize)(struct netlink_serialization_params *params);
56 struct netlink_serialization_params params;
57 } netlink_serialization_command;
59 int create_netlink(int protocol, uint32_t groups);
60 int read_netlink(int sock, void *buf, size_t len);