Run script that removes trailing whitespace everywhere.
req.ndm.ndm_flags |= NTF_MASTER;
} else if (matches(*argv, "router") == 0) {
req.ndm.ndm_flags |= NTF_ROUTER;
- } else if (matches(*argv, "local") == 0 ||
+ } else if (matches(*argv, "local") == 0 ||
matches(*argv, "permanent") == 0) {
req.ndm.ndm_state |= NUD_PERMANENT;
} else if (matches(*argv, "temp") == 0 ||
fprintf(fp, "\n");
}
-
+
static int print_ctrl_cmds(FILE *fp, struct rtattr *arg, __u32 ctrl_ver)
{
struct rtattr *tb[CTRL_ATTR_OP_MAX + 1];
#include <linux/neighbour.h>
#include <linux/netconf.h>
-struct rtnl_handle
-{
+struct rtnl_handle {
int fd;
struct sockaddr_nl local;
struct sockaddr_nl peer;
extern int rcvbuf;
-int rtnl_open(struct rtnl_handle *rth, unsigned subscriptions)
+int rtnl_open(struct rtnl_handle *rth, unsigned int subscriptions)
__attribute__((warn_unused_result));
-int rtnl_open_byproto(struct rtnl_handle *rth, unsigned subscriptions,
+int rtnl_open_byproto(struct rtnl_handle *rth, unsigned int subscriptions,
int protocol)
__attribute__((warn_unused_result));
struct rtnl_ctrl_data *,
struct nlmsghdr *n, void *);
-struct rtnl_dump_filter_arg
-{
+struct rtnl_dump_filter_arg {
rtnl_filter_t filter;
void *arg1;
__u16 nc_flags;
static inline __u64 rta_getattr_u64(const struct rtattr *rta)
{
__u64 tmp;
+
memcpy(&tmp, RTA_DATA(rta), sizeof(__u64));
return tmp;
}
#ifndef IFA_RTA
#define IFA_RTA(r) \
- ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifaddrmsg))))
+ ((struct rtattr *)(((char *)(r)) + NLMSG_ALIGN(sizeof(struct ifaddrmsg))))
#endif
#ifndef IFA_PAYLOAD
-#define IFA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifaddrmsg))
+#define IFA_PAYLOAD(n) NLMSG_PAYLOAD(n, sizeof(struct ifaddrmsg))
#endif
#ifndef IFLA_RTA
#define IFLA_RTA(r) \
- ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg))))
+ ((struct rtattr *)(((char *)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg))))
#endif
#ifndef IFLA_PAYLOAD
-#define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg))
+#define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n, sizeof(struct ifinfomsg))
#endif
#ifndef NDA_RTA
#define NDA_RTA(r) \
- ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ndmsg))))
+ ((struct rtattr *)(((char *)(r)) + NLMSG_ALIGN(sizeof(struct ndmsg))))
#endif
#ifndef NDA_PAYLOAD
-#define NDA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ndmsg))
+#define NDA_PAYLOAD(n) NLMSG_PAYLOAD(n, sizeof(struct ndmsg))
#endif
#ifndef NDTA_RTA
#define NDTA_RTA(r) \
- ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ndtmsg))))
+ ((struct rtattr *)(((char *)(r)) + NLMSG_ALIGN(sizeof(struct ndtmsg))))
#endif
#ifndef NDTA_PAYLOAD
-#define NDTA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ndtmsg))
+#define NDTA_PAYLOAD(n) NLMSG_PAYLOAD(n, sizeof(struct ndtmsg))
#endif
#ifndef NETNS_RTA
#define NETNS_RTA(r) \
- ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct rtgenmsg))))
+ ((struct rtattr *)(((char *)(r)) + NLMSG_ALIGN(sizeof(struct rtgenmsg))))
#endif
#ifndef NETNS_PAYLOAD
-#define NETNS_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct rtgenmsg))
+#define NETNS_PAYLOAD(n) NLMSG_PAYLOAD(n, sizeof(struct rtgenmsg))
#endif
/* User defined nlmsg_type which is used mostly for logging netlink
#define NLMSG_TSTAMP 15
#endif /* __LIBNETLINK_H__ */
-
* Coverity Scan doesn't pick up modifications automatically. The model file
* must be uploaded by an admin.
*/
-
-
return genl_parse_getfamily(&req.n);
}
-
struct nlmsgerr *err = (struct nlmsgerr*)NLMSG_DATA(h);
if (h->nlmsg_len < NLMSG_LENGTH(sizeof(struct nlmsgerr)))
fprintf(stderr, "ERROR truncated\n");
- else
+ else
errno = -err->error;
return -1;
}
/* try coverting dotted quad to CIDR */
if (!get_addr_1(&addr, arg, AF_INET) && addr.family == AF_INET) {
int b = mask2bits(addr.data[0]);
-
+
if (b >= 0) {
*val = b;
return 0;
*val = t;
if (*val < t)
*val += 1;
-
+
return 0;
}
for (i = 0; i < 4; i++) {
unsigned long n;
char *endp;
-
+
n = strtoul(cp, &endp, 0);
if (n > 255)
return -1; /* bogus network value */
}
} else {
fp = stdin;
- }
+ }
x = readdoubles(fp, &limit);
if (limit <= 0) {
fprintf(stderr, "Nothing much read!\n");
fprintf(stderr, "%d values, mu %10.4f, sigma %10.4f, rho %10.4f\n",
limit, mu, sigma, rho);
#endif
-
+
table = makedist(x, limit, mu, sigma);
free((void *) x);
cumulativedist(table, DISTTABLESIZE, &total);
table[i] = x;
}
-
+
printf("# This is the distribution table for the normal distribution.\n");
for (i = n = 0; i < TABLESIZE; i += 4) {
int value = (int) rint(table[i]*TABLEFACTOR);
n = 0;
}
}
-
+
return 0;
-}
+}
if (dvalue > 32767)
dvalue = 32767;
return (int)rint(dvalue);
-}
+}
int
main(int argc, char **argv)
new_cmd(char **argv)
{
if ((matches(*argv, "change") == 0) ||
- (matches(*argv, "replace") == 0) ||
- (matches(*argv, "delete") == 0) ||
- (matches(*argv, "get") == 0) ||
+ (matches(*argv, "replace") == 0) ||
+ (matches(*argv, "delete") == 0) ||
+ (matches(*argv, "get") == 0) ||
(matches(*argv, "add") == 0))
return 1;
rtab[i] = tc_calc_xmittime(bps, sz);
}
- r->cell_align = -1;
+ r->cell_align = -1;
r->cell_log = cell_log;
r->linklayer = (linklayer & TC_LINKLAYER_MASK);
return cell_log;