Coverage Report

Created: 2023-09-25 07:12

/src/open5gs/lib/core/ogs-conv.h
Line
Count
Source (jump to first uncovered line)
1
/*
2
 * Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
3
 *
4
 * This file is part of Open5GS.
5
 *
6
 * This program is free software: you can redistribute it and/or modify
7
 * it under the terms of the GNU Affero General Public License as published by
8
 * the Free Software Foundation, either version 3 of the License, or
9
 * (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
18
 */
19
20
#if !defined(OGS_CORE_INSIDE) && !defined(OGS_CORE_COMPILATION)
21
#error "This header cannot be included directly."
22
#endif
23
24
#ifndef OGS_CONV_H
25
#define OGS_CONV_H
26
27
#ifdef __cplusplus
28
extern "C" {
29
#endif
30
31
int ogs_ascii_to_hex(char *in, int in_len, void *out, int out_len);
32
static ogs_inline void *ogs_hex_from_string(
33
        const char *str, void *out, int out_len)
34
0
{
35
0
    ogs_ascii_to_hex((char*)str, strlen(str), out, out_len);
36
0
    return out;
37
0
}
Unexecuted instantiation: nas-message-fuzz.c:ogs_hex_from_string
Unexecuted instantiation: decoder.c:ogs_hex_from_string
Unexecuted instantiation: ies.c:ogs_hex_from_string
Unexecuted instantiation: types.c:ogs_hex_from_string
Unexecuted instantiation: ogs-abort.c:ogs_hex_from_string
Unexecuted instantiation: ogs-strings.c:ogs_hex_from_string
Unexecuted instantiation: ogs-conv.c:ogs_hex_from_string
Unexecuted instantiation: ogs-log.c:ogs_hex_from_string
Unexecuted instantiation: ogs-pkbuf.c:ogs_hex_from_string
Unexecuted instantiation: ogs-memory.c:ogs_hex_from_string
Unexecuted instantiation: ogs-sockaddr.c:ogs_hex_from_string
Unexecuted instantiation: ogs-core.c:ogs_hex_from_string
Unexecuted instantiation: ogs-errno.c:ogs_hex_from_string
Unexecuted instantiation: ogs-time.c:ogs_hex_from_string
Unexecuted instantiation: ogs-socket.c:ogs_hex_from_string
Unexecuted instantiation: ogs-tlv.c:ogs_hex_from_string
Unexecuted instantiation: gtp-message-fuzz.c:ogs_hex_from_string
Unexecuted instantiation: context.c:ogs_hex_from_string
Unexecuted instantiation: xact.c:ogs_hex_from_string
Unexecuted instantiation: conv.c:ogs_hex_from_string
Unexecuted instantiation: message.c:ogs_hex_from_string
Unexecuted instantiation: path.c:ogs_hex_from_string
Unexecuted instantiation: build.c:ogs_hex_from_string
Unexecuted instantiation: ogs-timer.c:ogs_hex_from_string
Unexecuted instantiation: ogs-socknode.c:ogs_hex_from_string
Unexecuted instantiation: ogs-udp.c:ogs_hex_from_string
Unexecuted instantiation: ogs-poll.c:ogs_hex_from_string
Unexecuted instantiation: ogs-tlv-msg.c:ogs_hex_from_string
Unexecuted instantiation: ogs-epoll.c:ogs_hex_from_string
Unexecuted instantiation: ogs-rbtree.c:ogs_hex_from_string
Unexecuted instantiation: ogs-sockopt.c:ogs_hex_from_string
Unexecuted instantiation: ogs-notify.c:ogs_hex_from_string
Unexecuted instantiation: ogs-hash.c:ogs_hex_from_string
Unexecuted instantiation: ogs-yaml.c:ogs_hex_from_string
Unexecuted instantiation: ogs-context.c:ogs_hex_from_string
Unexecuted instantiation: ogs-config.c:ogs_hex_from_string
Unexecuted instantiation: ogs-init.c:ogs_hex_from_string
Unexecuted instantiation: ogs-queue.c:ogs_hex_from_string
Unexecuted instantiation: ogs-env.c:ogs_hex_from_string
38
39
void *ogs_hex_to_ascii(void *in, int in_len, void *out, int out_len);
40
void *ogs_uint64_to_buffer(uint64_t num, int size, void *buffer);
41
uint64_t ogs_buffer_to_uint64(void *buffer, int size);
42
void *ogs_bcd_to_buffer(const char *in, void *out, int *out_len);
43
void *ogs_bcd_to_buffer_reverse_order(const char *in, void *out, int *out_len);
44
void *ogs_buffer_to_bcd(uint8_t *in, int in_len, void *out);
45
46
char ogs_from_hex(char ch);
47
48
char *ogs_uint24_to_0string(ogs_uint24_t x);
49
char *ogs_uint28_to_0string(uint32_t x);
50
char *ogs_uint32_to_0string(uint32_t x);
51
char *ogs_uint36_to_0string(uint64_t x);
52
char *ogs_uint64_to_0string(uint64_t x);
53
char *ogs_uint64_to_string(uint64_t x);
54
55
ogs_uint24_t ogs_uint24_from_string(char *str);
56
uint64_t ogs_uint64_from_string(char *str);
57
58
double *ogs_alloc_double(double value);
59
60
#ifdef __cplusplus
61
}
62
#endif
63
64
#endif /* OGS_CONV_H */