This file is indexed.

/usr/include/htp/bstr.h is in libhtp-dev 0.2.6-1build1.

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
/*
 * LibHTP (http://www.libhtp.org)
 * Copyright 2009,2010 Ivan Ristic <ivanr@webkreator.com>
 *
 * LibHTP is an open source product, released under terms of the General Public Licence
 * version 2 (GPLv2). Please refer to the file LICENSE, which contains the complete text
 * of the license.
 *
 * In addition, there is a special exception that allows LibHTP to be freely
 * used with any OSI-approved open source licence. Please refer to the file
 * LIBHTP_LICENSING_EXCEPTION for the full text of the exception.
 *
 */

#ifndef _BSTR_H
#define	_BSTR_H

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

// IMPORTANT This binary string library is used internally by the parser and you should
//           not rely on it in your code. The implementation may change.
//
// TODO
//           - Add a function that wraps an existing data
//           - Support Unicode bstrings

typedef void * bstr;

bstr *bstr_alloc(size_t newsize);
void  bstr_free(bstr *s);
bstr *bstr_expand(bstr *s, size_t newsize);
bstr *bstr_cstrdup(char *);
bstr *bstr_memdup(char *data, size_t len);
bstr *bstr_strdup(bstr *b);
bstr *bstr_strdup_ex(bstr *b, size_t offset, size_t len);
char *bstr_tocstr(bstr *);

int bstr_chr(bstr *, int);
int bstr_rchr(bstr *, int);

int bstr_cmpc(bstr *, char *);
int bstr_cmp(bstr *, bstr *);

bstr *bstr_dup_lower(bstr *);
bstr *bstr_tolowercase(bstr *);

bstr *bstr_add_mem(bstr *, char *, size_t);
bstr *bstr_add_str(bstr *, bstr *);
bstr *bstr_add_cstr(bstr *, char *);

bstr *bstr_add_mem_noex(bstr *, char *, size_t);
bstr *bstr_add_str_noex(bstr *, bstr *);
bstr *bstr_add_cstr_noex(bstr *, char *);

int bstr_util_memtoip(char *data, size_t len, int base, size_t *lastlen);
char *bstr_memtocstr(char *data, size_t len);

int bstr_indexof(bstr *haystack, bstr *needle);
int bstr_indexofc(bstr *haystack, char *needle);
int bstr_indexof_nocase(bstr *haystack, bstr *needle);
int bstr_indexofc_nocase(bstr *haystack, char *needle);
int bstr_indexofmem(bstr *haystack, char *data, size_t len);
int bstr_indexofmem_nocase(bstr *haystack, char *data, size_t len);

void bstr_chop(bstr *b);
void bstr_len_adjust(bstr *s, size_t newlen);

char bstr_char_at(bstr *s, size_t pos);
 
typedef struct bstr_t bstr_t;

struct bstr_t {
    /** The length of the string stored in the buffer. */
    size_t len;
      
    /** The current size of the buffer. If the buffer is bigger than the
     *  string then it will be able to expand without having to reallocate.
     */
    size_t size;

    /** Optional buffer pointer. If this pointer is NUL (as it currently is
     *  in virtually all cases, the string buffer will immediatelly follow
     *  this structure. If the pointer is not NUL, it points to the actual
     *  buffer used, and there's no data following this structure.
     */
    char *ptr;
};

#define bstr_len(X) ((*(bstr_t *)(X)).len)
#define bstr_size(X) ((*(bstr_t *)(X)).size)
#define bstr_ptr(X) ( ((*(bstr_t *)(X)).ptr == NULL) ? (char *)((char *)(X) + sizeof(bstr_t)) : (char *)(*(bstr_t *)(X)).ptr )

#endif	/* _BSTR_H */