LCOV - code coverage report
Current view: top level - basic - ether-addr-util.h (source / functions) Hit Total Coverage
Test: main_coverage.info Lines: 4 4 100.0 %
Date: 2019-08-22 15:41:25 Functions: 2 2 100.0 %

          Line data    Source code
       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          55 : static inline bool ether_addr_equal(const struct ether_addr *a, const struct ether_addr *b) {
      17          55 :         return ether_addr_compare(a, b) == 0;
      18             : }
      19             : 
      20             : #define ETHER_ADDR_NULL ((const struct ether_addr){})
      21             : 
      22          44 : static inline bool ether_addr_is_null(const struct ether_addr *addr) {
      23          44 :         return ether_addr_equal(addr, &ETHER_ADDR_NULL);
      24             : }
      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;

Generated by: LCOV version 1.14