Coverage Report

Created: 2026-05-25 06:55

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
298
{
17
298
  uint32_t val;
18
298
  memcpy(&val, buf, sizeof(val));
19
  /* val is in netorder */
20
298
  val = ntohl(val);
21
  /* val is in hostorder */
22
298
  return val;
23
298
}
24
25
void pim_write_uint32(uint8_t *buf, uint32_t val_host)
26
308
{
27
  /* val_host is in host order */
28
308
  val_host = htonl(val_host);
29
  /* val_host is in netorder */
30
308
  memcpy(buf, &val_host, sizeof(val_host));
31
308
}