2
* src/lib/class.c CLI Class Helpers
4
* This library is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU Lesser General Public
6
* License as published by the Free Software Foundation version 2.1
9
* Copyright (c) 2010-2011 Thomas Graf <tgraf@suug.ch>
14
* @defgroup cli_class Traffic Classes
18
#include <netlink/cli/utils.h>
19
#include <netlink/cli/class.h>
21
struct rtnl_class *nl_cli_class_alloc(void)
23
struct rtnl_class *class;
25
if (!(class = rtnl_class_alloc()))
26
nl_cli_fatal(ENOMEM, "Unable to allocate class object");
31
struct nl_cache *nl_cli_class_alloc_cache(struct nl_sock *sock, int ifindex)
33
struct nl_cache *cache;
36
if ((err = rtnl_class_alloc_cache(sock, ifindex, &cache)) < 0)
37
nl_cli_fatal(err, "Unable to allocate class cache: %s",
40
nl_cache_mngt_provide(cache);