dect
/
libnl
Archived
13
0
Fork 0
This repository has been archived on 2022-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
libnl/src/rule-utils.c

32 lines
677 B
C

/*
* src/rule-utils.c Routing Rule Helpers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation version 2.1
* of the License.
*
* Copyright (c) 2008 Thomas Graf <tgraf@suug.ch>
*/
#include "rule-utils.h"
struct rtnl_rule *nlt_alloc_rule(void)
{
struct rtnl_rule *rule;
rule = rtnl_rule_alloc();
if (!rule)
fatal(ENOMEM, "Unable to allocate rule object");
return rule;
}
void parse_family(struct rtnl_rule *rule, char *arg)
{
int family;
if ((family = nl_str2af(arg)) != AF_UNSPEC)
rtnl_rule_set_family(rule, family);
}