This file is indexed.

/usr/include/paristraceroute/bits.h is in libparistraceroute-dev 0.93+git20160927-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#include "use.h"

#ifndef BITS_H
#define BITS_H

#include <stdbool.h> // bool
#include <stdint.h>  // uint*_t
#include <stddef.h>  // size_t

//---------------------------------------------------------------------------
// Bit-level operations on a single byte
//---------------------------------------------------------------------------

/**
 * \brief Make a uint8_t mask having num_bits bits set to 1 starting to the
 *    offset_in_bits-th bit. The other bits are set to 0.
 * \param offset_in_bits The first bit set to 1.
 * \param num_bits The number of bits set to 1.
 * \return The corresponding mask.
 */

uint8_t byte_make_mask(size_t offset_in_bits, size_t num_bits);

/**
 * \brief Extract 'num_bits' bits from a uint8_t starting from its
 *    'offset_in_bits'-th bit and but the result in an output byte
 *    with the an offset of 'offset_in_bits_out' bits.
 * \param byte The queried byte.
 * \param offset_in_bits The first extracted bit of 'byte'.
 * \param num_bits The number of extracted bits.
 * \param offset_in_bits_out The starting bit where we write in the
 *    returned value.
 * \return The corresponding value.
 */

uint8_t byte_extract(uint8_t byte, size_t offset_in_bits, size_t num_bits, size_t offset_in_bits_out);

/**
 * \brief Write a sequence of bits in an output byte according
 *    to a given input byte.
 * \param byte_out The address of the output byte.
 * \param offset_in_bits_out The offset of the first bit we
 *    write in byte_out.
 * \param byte_in The byte we read to update byte_out.
 * \param offset_in_bits_out The offset of the first bit we
 *    read in byte_in.
 * \param size_in_bits The number of bits copied from
 *    byte_in to byte_out. This value must satisfy:
 *      - 0 <= size_in_bits <= 8
 *      - offset_in_bits_out + size_in_bits <= 8
 * \return true iif successful
 */

bool byte_write_bits(
    uint8_t * byte_out,
    size_t    offset_in_bits_out,
    uint8_t   byte_in,
    size_t    offset_in_bits_in,
    size_t    size_in_bits
);

/**
 * \brief Write a byte in the standard output (binary format).
 * \param byte The byte we want to write. 
 */

void byte_dump(uint8_t byte);

//---------------------------------------------------------------------------
// Bit-level operations on one or more bytes 
//---------------------------------------------------------------------------

/**
 * \brief Extract 'num_bits' bits from a sequence of bytes starting from its
 *    'offset_in_bits'-th bit and but the result in an output sequence of bytes
 *    with the an offset of 'offset_in_bits_out' bits.
 * \param bytes The queried bytes.
 * \param offset_in_bits The first extracted bit of 'bytes'.
 * \param num_bits The number of extracted bits.
 * \param offset_in_bits_out The starting bit where we write in the *pdest.
 * \param dest The uint8_t * which will store the output value. Pass NULL if
 *    bits_extract must allocate automatically this buffer. This buffer must
 *    be at least of size (offset_in_bits + num_bits % 8) 
 * \return The corresponding output buffer, NULL in case of failure.
 *
 * Example:
 * 
 *   bits_extract(x = 00111010 11111010 11000000 00000000, 2, 21) = 00011101 01111101 01100000
 *   21 bits are extract from x (starting from the 2nd bit of x)
 *   They are copied and right-aligned in y.
 * 
 * This example is detailed in bits.c (see function bits_test).
 */

// TODO change parameter order (first output parameters, then input parameters)
uint8_t * bits_extract(
    const uint8_t * bytes,
    size_t          offset_in_bits,
    size_t          num_bits,
    uint8_t       * dest
);

/**
 * \brief Write a sequence of bits according to a given sequence
 *    of input bits.
 * \param out The address of the output sequence of bits 
 * \param offset_in_bits_out The offset of the first bit we
 *    write in out.
 * \param in The sequence of bits we read to update out.
 * \param offset_in_bits_out The offset of the first bit we
 *    read in the input bits.
 * \param size_in_bits The number of bits copied from
 *    in to out.
 * \return true iif successful
 */

bool bits_write(
    uint8_t       * out,
    const size_t    offset_in_bits_out,
    const uint8_t * in,
    const size_t    offset_in_bits_in,
    size_t          length_in_bits
);

/**
 * \brief Write a byte in the standard output (binary format).
 * \param byte The byte we want to write. 
 */

void bits_dump(const uint8_t * bytes, size_t num_bytes);

#endif