Coverage Report

Created: 2019-06-19 13:33

/src/systemd/src/basic/ether-addr-util.h
Line
Count
Source
1
/* SPDX-License-Identifier: LGPL-2.1+ */
2
#pragma once
3
4
#include <net/ethernet.h>
5
#include <stdbool.h>
6
7
#include "hash-funcs.h"
8
9
#define ETHER_ADDR_FORMAT_STR "%02X%02X%02X%02X%02X%02X"
10
#define ETHER_ADDR_FORMAT_VAL(x) (x).ether_addr_octet[0], (x).ether_addr_octet[1], (x).ether_addr_octet[2], (x).ether_addr_octet[3], (x).ether_addr_octet[4], (x).ether_addr_octet[5]
11
12
#define ETHER_ADDR_TO_STRING_MAX (3*6)
13
char* ether_addr_to_string(const struct ether_addr *addr, char buffer[ETHER_ADDR_TO_STRING_MAX]);
14
15
int ether_addr_compare(const struct ether_addr *a, const struct ether_addr *b);
16
1.01k
static inline bool ether_addr_equal(const struct ether_addr *a, const struct ether_addr *b) {
17
1.01k
        return ether_addr_compare(a, b) == 0;
18
1.01k
}
Unexecuted instantiation: fuzz-netdev-parser.c:ether_addr_equal
Unexecuted instantiation: netdev.c:ether_addr_equal
Unexecuted instantiation: geneve.c:ether_addr_equal
Unexecuted instantiation: wireguard.c:ether_addr_equal
Unexecuted instantiation: fou-tunnel.c:ether_addr_equal
Unexecuted instantiation: l2tp-tunnel.c:ether_addr_equal
Unexecuted instantiation: macsec.c:ether_addr_equal
Unexecuted instantiation: networkd-link.c:ether_addr_equal
Unexecuted instantiation: networkd-lldp-rx.c:ether_addr_equal
Unexecuted instantiation: networkd-lldp-tx.c:ether_addr_equal
Unexecuted instantiation: networkd-manager.c:ether_addr_equal
Unexecuted instantiation: networkd-ndisc.c:ether_addr_equal
Unexecuted instantiation: networkd-neighbor.c:ether_addr_equal
Unexecuted instantiation: networkd-radv.c:ether_addr_equal
Unexecuted instantiation: networkd-network-bus.c:ether_addr_equal
Unexecuted instantiation: networkd-network.c:ether_addr_equal
Unexecuted instantiation: networkd-route.c:ether_addr_equal
Unexecuted instantiation: networkd-routing-policy-rule.c:ether_addr_equal
Unexecuted instantiation: networkd-speed-meter.c:ether_addr_equal
Unexecuted instantiation: networkd-network-gperf.c:ether_addr_equal
Unexecuted instantiation: netdev-gperf.c:ether_addr_equal
bond.c:ether_addr_equal
Line
Count
Source
16
917
static inline bool ether_addr_equal(const struct ether_addr *a, const struct ether_addr *b) {
17
917
        return ether_addr_compare(a, b) == 0;
18
917
}
Unexecuted instantiation: bridge.c:ether_addr_equal
Unexecuted instantiation: networkd-address-label.c:ether_addr_equal
Unexecuted instantiation: networkd-address-pool.c:ether_addr_equal
Unexecuted instantiation: networkd-address.c:ether_addr_equal
Unexecuted instantiation: networkd-brvlan.c:ether_addr_equal
Unexecuted instantiation: networkd-can.c:ether_addr_equal
Unexecuted instantiation: networkd-conf.c:ether_addr_equal
Unexecuted instantiation: networkd-dhcp4.c:ether_addr_equal
Unexecuted instantiation: networkd-dhcp6.c:ether_addr_equal
Unexecuted instantiation: networkd-fdb.c:ether_addr_equal
Unexecuted instantiation: networkd-ipv4ll.c:ether_addr_equal
Unexecuted instantiation: networkd-ipv6-proxy-ndp.c:ether_addr_equal
Unexecuted instantiation: networkd-link-bus.c:ether_addr_equal
Unexecuted instantiation: networkd-manager-bus.c:ether_addr_equal
Unexecuted instantiation: networkd-gperf.c:ether_addr_equal
Unexecuted instantiation: sd-ipv4ll.c:ether_addr_equal
Unexecuted instantiation: sd-ipv4acd.c:ether_addr_equal
Unexecuted instantiation: network-internal.c:ether_addr_equal
Unexecuted instantiation: sd-radv.c:ether_addr_equal
Unexecuted instantiation: lldp-neighbor.c:ether_addr_equal
sd-lldp.c:ether_addr_equal
Line
Count
Source
16
99
static inline bool ether_addr_equal(const struct ether_addr *a, const struct ether_addr *b) {
17
99
        return ether_addr_compare(a, b) == 0;
18
99
}
Unexecuted instantiation: fuzz-network-parser.c:ether_addr_equal
Unexecuted instantiation: nspawn-network.c:ether_addr_equal
Unexecuted instantiation: ether-addr-util.c:ether_addr_equal
19
20
9.84k
#define ETHER_ADDR_NULL ((const struct ether_addr){})
21
22
1.01k
static inline bool ether_addr_is_null(const struct ether_addr *addr) {
23
1.01k
        return ether_addr_equal(addr, &ETHER_ADDR_NULL);
24
1.01k
}
Unexecuted instantiation: fuzz-netdev-parser.c:ether_addr_is_null
Unexecuted instantiation: netdev.c:ether_addr_is_null
Unexecuted instantiation: geneve.c:ether_addr_is_null
Unexecuted instantiation: wireguard.c:ether_addr_is_null
Unexecuted instantiation: fou-tunnel.c:ether_addr_is_null
Unexecuted instantiation: l2tp-tunnel.c:ether_addr_is_null
Unexecuted instantiation: macsec.c:ether_addr_is_null
Unexecuted instantiation: networkd-link.c:ether_addr_is_null
Unexecuted instantiation: networkd-lldp-rx.c:ether_addr_is_null
Unexecuted instantiation: networkd-lldp-tx.c:ether_addr_is_null
Unexecuted instantiation: networkd-manager.c:ether_addr_is_null
Unexecuted instantiation: networkd-ndisc.c:ether_addr_is_null
Unexecuted instantiation: networkd-neighbor.c:ether_addr_is_null
Unexecuted instantiation: networkd-radv.c:ether_addr_is_null
Unexecuted instantiation: networkd-network-bus.c:ether_addr_is_null
Unexecuted instantiation: networkd-network.c:ether_addr_is_null
Unexecuted instantiation: networkd-route.c:ether_addr_is_null
Unexecuted instantiation: networkd-routing-policy-rule.c:ether_addr_is_null
Unexecuted instantiation: networkd-speed-meter.c:ether_addr_is_null
Unexecuted instantiation: networkd-network-gperf.c:ether_addr_is_null
Unexecuted instantiation: netdev-gperf.c:ether_addr_is_null
bond.c:ether_addr_is_null
Line
Count
Source
22
917
static inline bool ether_addr_is_null(const struct ether_addr *addr) {
23
917
        return ether_addr_equal(addr, &ETHER_ADDR_NULL);
24
917
}
Unexecuted instantiation: bridge.c:ether_addr_is_null
Unexecuted instantiation: networkd-address-label.c:ether_addr_is_null
Unexecuted instantiation: networkd-address-pool.c:ether_addr_is_null
Unexecuted instantiation: networkd-address.c:ether_addr_is_null
Unexecuted instantiation: networkd-brvlan.c:ether_addr_is_null
Unexecuted instantiation: networkd-can.c:ether_addr_is_null
Unexecuted instantiation: networkd-conf.c:ether_addr_is_null
Unexecuted instantiation: networkd-dhcp4.c:ether_addr_is_null
Unexecuted instantiation: networkd-dhcp6.c:ether_addr_is_null
Unexecuted instantiation: networkd-fdb.c:ether_addr_is_null
Unexecuted instantiation: networkd-ipv4ll.c:ether_addr_is_null
Unexecuted instantiation: networkd-ipv6-proxy-ndp.c:ether_addr_is_null
Unexecuted instantiation: networkd-link-bus.c:ether_addr_is_null
Unexecuted instantiation: networkd-manager-bus.c:ether_addr_is_null
Unexecuted instantiation: networkd-gperf.c:ether_addr_is_null
Unexecuted instantiation: sd-ipv4ll.c:ether_addr_is_null
Unexecuted instantiation: sd-ipv4acd.c:ether_addr_is_null
Unexecuted instantiation: network-internal.c:ether_addr_is_null
Unexecuted instantiation: sd-radv.c:ether_addr_is_null
Unexecuted instantiation: lldp-neighbor.c:ether_addr_is_null
sd-lldp.c:ether_addr_is_null
Line
Count
Source
22
99
static inline bool ether_addr_is_null(const struct ether_addr *addr) {
23
99
        return ether_addr_equal(addr, &ETHER_ADDR_NULL);
24
99
}
Unexecuted instantiation: fuzz-network-parser.c:ether_addr_is_null
Unexecuted instantiation: nspawn-network.c:ether_addr_is_null
Unexecuted instantiation: ether-addr-util.c:ether_addr_is_null
25
26
int ether_addr_from_string(const char *s, struct ether_addr *ret);
27
28
extern const struct hash_ops ether_addr_hash_ops;