Coverage Report

Created: 2026-08-11 07:10

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/frr/pimd/pim_int.c
Line
Count
Source
1
// SPDX-License-Identifier: GPL-2.0-or-later
2
/*
3
 * PIM for Quagga
4
 * Copyright (C) 2008  Everton da Silva Marques
5
 */
6
7
#include <zebra.h>
8
9
#include <string.h>
10
#include <netinet/in.h>
11
#include <arpa/inet.h>
12
13
#include "pim_int.h"
14
15
uint32_t pim_read_uint32_host(const uint8_t *buf)
16
524
{
17
524
  uint32_t val;
18
524
  memcpy(&val, buf, sizeof(val));
19
  /* val is in netorder */
20
524
  val = ntohl(val);
21
  /* val is in hostorder */
22
524
  return val;
23
524
}
24
25
void pim_write_uint32(uint8_t *buf, uint32_t val_host)
26
676
{
27
  /* val_host is in host order */
28
676
  val_host = htonl(val_host);
29
  /* val_host is in netorder */
30
676
  memcpy(buf, &val_host, sizeof(val_host));
31
676
}