mirror_kronosnet/libknet/netutils.h
Fabio M. Di Nitto 3c58f255e7 [rx] fix per link stats for data packets
and cleanup all netutils common functions

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
2020-08-20 10:29:43 +02:00

30 lines
693 B
C

/*
* Copyright (C) 2010-2020 Red Hat, Inc. All rights reserved.
*
* Authors: Fabio M. Di Nitto <fabbione@kronosnet.org>
* Federico Simoncelli <fsimon@kronosnet.org>
*
* This software licensed under LGPL-2.0+
*/
#ifndef __KNET_NETUTILS_H__
#define __KNET_NETUTILS_H__
#include <sys/socket.h>
#include <netinet/in.h>
/*
* s6_addr32 is not defined in BSD userland, only kernel.
* definition is the same as linux and it works fine for
* what we need.
*/
#ifndef s6_addr32
#define s6_addr32 __u6_addr.__u6_addr32
#endif
int cmpaddr(const struct sockaddr_storage *ss1, const struct sockaddr_storage *ss2);
socklen_t sockaddr_len(const struct sockaddr_storage *ss);
#endif