Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull changes from development (08/2022) #49

Draft
wants to merge 120 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
ed56a22
Automatic merge from master -> develop
HRogge Sep 13, 2018
8d70939
Add route_modifier plugin to olsrd2
HRogge Oct 1, 2018
30e39f6
Merge pull request #20 in FKIEA/oonf-os from feature/MOTOR-67-add-rou…
HRogge Oct 1, 2018
a1a4c7e
Fixed scaling factor in methods:
Oct 10, 2018
979fdc7
Merge pull request #21 in FKIEA/oonf-os from bugfix/MOTOR-68-floating…
Oct 10, 2018
a661b23
Fix definition of ethernet multicast groups
HRogge Nov 7, 2018
bd9fe7e
Merge pull request #22 in FKIEA/oonf-os from bugfix/MOTOR-75-fix-comp…
HRogge Nov 7, 2018
37e029c
copy packet socket interface name for os_interface listener
HRogge Nov 7, 2018
62d2a92
Merge pull request #23 in FKIEA/oonf-os from bugfix/OONF-6-copy-packe…
HRogge Nov 7, 2018
b40c949
copy acl configuration from managed stream socket into all sub-sockets
HRogge Nov 9, 2018
e7c3dd7
Merge pull request #24 in FKIEA/oonf-os from bugfix/OONF-7-managed-st…
HRogge Nov 9, 2018
a7904f2
First code revision that does not freeze the netlink sockets in autom…
HRogge Jan 16, 2019
00b20a5
Fix some comment/formatting issues
HRogge Jan 16, 2019
32e76cc
Merge pull request #25 in FKIEA/oonf-os from bugfix/OONF-8-simulate-n…
HRogge Jan 16, 2019
0339b09
keep track of peer addresses in L2 db when cleaning up
HRogge Feb 5, 2019
20aebf8
Merge pull request #26 in FKIEA/oonf-os from bugfix/MOTOR-77-l2-clean…
HRogge Feb 5, 2019
491ee87
Fix type in netjsoninfo route output to match the netjson.org schema
HRogge Mar 13, 2019
95eb6b4
Merge pull request #27 in FKIEA/oonf-os from bugfix/OONF-9-netjsoninf…
HRogge Mar 13, 2019
2f6d196
Add better debugging output for timer values and l2 originators
HRogge Mar 26, 2019
d3735d9
Merge pull request #28 in FKIEA/oonf-os from feature/OONF-10-improve-…
HRogge Mar 26, 2019
2f0b86e
Add support for Netjson LINK command
HRogge Apr 15, 2019
90e8271
Merge pull request #29 in FKIEA/oonf-os from feature/OONF-11-add-netj…
HRogge Apr 15, 2019
506c7b8
Fix data type of netjsoninfo
HRogge Apr 16, 2019
1e3a139
Merge pull request #30 in FKIEA/oonf-os from bugfix/OONF-12-netjsonin…
HRogge Apr 16, 2019
ab24b06
Fix custom netjsoninfo extensions
HRogge Apr 17, 2019
7805711
Merge pull request #31 in FKIEA/oonf-os from bugfix/OONF-12-netjsonin…
HRogge Apr 17, 2019
7cbd134
Simplify netjsoninfo id output
HRogge Apr 17, 2019
1bbb48d
Merge pull request #32 in FKIEA/oonf-os from feature/OONF-13-simplify…
HRogge Apr 17, 2019
bd94012
Add ACL setting to dlep_radio to fix TCP session problem because of w…
HRogge Apr 25, 2019
a0a11ab
Merge pull request #33 in FKIEA/oonf-os from bugfix/OONF-14-add-acl-s…
HRogge Apr 25, 2019
35b3f24
Add IP/Prefix type to layer2 data types and add a DNS interface type …
HRogge May 10, 2019
f96f182
Add DNS based service discovery
HRogge May 10, 2019
045a524
Add doxygen comments
HRogge May 10, 2019
9e14a81
Merge pull request #34 in FKIEA/oonf-os from feature/OONF-15-dns-base…
HRogge May 10, 2019
d2ef771
Add support for small isoprefixes on string parsing
HRogge May 16, 2019
3ef6099
Fix error case for unknown iso prefix
HRogge May 16, 2019
fe0e783
Fix testcase for isoprefix, 'a' is now a valid prefix
HRogge May 16, 2019
628a23c
Merge pull request #36 in FKIEA/oonf-os from bugfix/OONF-16-isonumber…
HRogge May 16, 2019
29d9546
Add better support for prefix filter in layer2 import and layer2 export
HRogge May 22, 2019
7432248
Unify dlep radio and router plugin and add telnet interface
HRogge May 22, 2019
b6566b3
Merge pull request #37 in FKIEA/oonf-os from feature/OONF-17-add-supp…
HRogge May 22, 2019
7537bc3
Add support for sending prefixes from router to radio with session up…
HRogge May 29, 2019
63f0aa1
Merge pull request #38 in FKIEA/oonf-os from feature/OONF-17-add-supp…
HRogge May 29, 2019
79647db
Fix gcc 8.3 release build
HRogge Jun 3, 2019
8844578
Merge pull request #39 in FKIEA/oonf-os from bugfix/OONF-18-fix-dlep-…
HRogge Jun 3, 2019
97d75c4
Continue with next filter-set when one filter of layer2import filter …
HRogge Jun 6, 2019
4bd9cbb
Merge pull request #40 in FKIEA/oonf-os from bugfix/OONF-19-layer2-im…
HRogge Jun 6, 2019
d388913
Forced trigger of metric recalculation listeners
HRogge Jun 7, 2019
c2c2eef
Merge pull request #41 in FKIEA/oonf-os from bugfix/OONF-20-fix-metri…
HRogge Jun 7, 2019
63d36f0
Fix netlink multicast definition system
HRogge Jul 1, 2019
7c3ea0b
Merge pull request #42 in FKIEA/oonf-os from bugfix/OONF-21-netlink-m…
HRogge Jul 1, 2019
6a478c7
fix raw json output for timer entries
HRogge Jul 12, 2019
be1e8c1
Merge pull request #43 in FKIEA/oonf-os from bugfix/OONF-22-fix-raw-j…
HRogge Jul 12, 2019
ee66c72
Add memory guards and class ID to OONF class manager
HRogge Oct 23, 2019
fd78be9
Fix segfault in DLEP extension deactivation
HRogge Jan 21, 2020
d4bc6c6
Merge pull request #44 in FKIEA/oonf-os from bugfix/OONF-24-dlep-cras…
HRogge Jan 21, 2020
ff167f9
Fix DLEP IANA values according to latest registry
HRogge Feb 4, 2020
50d35c6
Merge pull request #45 in FKIEA/oonf-os from bugfix/dlep-iana-registr…
HRogge Feb 14, 2020
226ed49
Add new delayed callback subsystem
HRogge Feb 14, 2020
463cd99
Merge pull request #46 in FKIEA/oonf-os from bugfix/packet-rfc5444-cy…
HRogge Feb 14, 2020
c875bdc
First set of DLEP fixes for clean shutdown
HRogge Feb 14, 2020
8c4aa73
Merge branch 'develop' into bugfix/dlep-shutdown-fixes
HRogge Feb 14, 2020
c1eefb9
Merge pull request #47 in FKIEA/oonf-os from bugfix/dlep-shutdown-fix…
HRogge Feb 17, 2020
8a77bb5
Merge branch 'develop' into feature/OONF-23-add-memory-guards-for-tra…
HRogge Feb 17, 2020
616c718
Merge pull request #48 in FKIEA/oonf-os from feature/OONF-23-add-memo…
HRogge Feb 17, 2020
0d99988
Fix dlep telnet source typo
HRogge Feb 17, 2020
9b133bf
Merge pull request #50 in FKIEA/oonf-os from bugfix/fix-dlep-telnet-t…
HRogge Feb 17, 2020
ae3580d
Fix layer2 access to network default data
HRogge Apr 3, 2020
b6a03c9
Merge pull request #51 in FKIEA/oonf-os from bugfix/fix-layer2-defaul…
HRogge Apr 3, 2020
2e20c85
Add support for DLEP rx/tx frame error rate TLV
HRogge Apr 14, 2020
cca2727
Add partial DLEP code for hopcount extension, hopcontrol still missing
HRogge Apr 14, 2020
4035f4f
fix tx-error rate and add multihop capability to DLEP
HRogge Apr 24, 2020
664fadd
Add packet error rate used size to DLEP/layer2
HRogge May 19, 2020
3c5c7ad
Add logging to olsrv2-l2import
HRogge Jun 24, 2020
a4740a1
Merge pull request #52 in FKIEA/oonf-os from bugfix/olsrv2_l2import-l…
HRogge Jun 24, 2020
67dd799
Sync olsrd2-dlep app plugins with olsrd2 app
HRogge Jun 25, 2020
da645aa
Merge pull request #53 in FKIEA/oonf-os from bugfix/update-olsrd2-dle…
HRogge Jun 25, 2020
942043c
Merge branch 'develop' into feature/Add-dlep-error-rate
HRogge Jun 26, 2020
f571665
Merge pull request #54 in FKIEA/oonf-os from feature/Add-dlep-error-r…
HRogge Jul 16, 2020
8127855
Allow routing tables up to 65535
HRogge Aug 13, 2020
d27bd2d
Merge pull request #55 in FKIEA/oonf-os from feature/increase-table-l…
HRogge Aug 13, 2020
927a77d
Add support for 32 bit routing tables in netlink code
HRogge Aug 13, 2020
5e6e9b2
Merge pull request #56 in FKIEA/oonf-os from feature/netlink-large-ta…
HRogge Aug 13, 2020
61ed1de
Add type 'all' to lan-import
HRogge Aug 27, 2020
c3caf21
Merge pull request #57 in FKIEA/oonf-os from feature/add-capture-all-…
HRogge Aug 27, 2020
253d4aa
Return exit code zero if the user uses --quit and nothing goes wrong
HRogge Aug 27, 2020
c0cbef6
Merge pull request #58 in FKIEA/oonf-os from feature/return-zero-from…
HRogge Aug 27, 2020
d678d3f
Add olsrv2info local telnet command
HRogge Sep 3, 2020
a313c5e
Merge pull request #59 in FKIEA/oonf-os from feature/add-olsrv2info-l…
HRogge Sep 3, 2020
4f8ae01
Fix triggering dijkstra when receiving LAN updates
HRogge Sep 3, 2020
607f967
Merge pull request #60 in FKIEA/oonf-os from bugfix/fix-olsrv2-lan-ha…
HRogge Sep 3, 2020
e5758c5
Allow import routing tables with a block of a specific protocol
HRogge Sep 7, 2020
0e138d7
Merge pull request #61 in FKIEA/oonf-os from feature/l2import-block-p…
HRogge Sep 7, 2020
49abf56
Add block_protocol to lan_import
HRogge Sep 7, 2020
eefb043
Merge pull request #62 in FKIEA/oonf-os from feature/l2import-block-p…
HRogge Sep 7, 2020
815b99d
Add l2net import feature
HRogge Sep 8, 2020
644df45
Merge pull request #63 in FKIEA/oonf-os from feature/l2import_l2net t…
HRogge Sep 8, 2020
c779869
Remove layer2 data on DLEP session teardown
HRogge Sep 14, 2020
c370810
Merge pull request #64 in FKIEA/oonf-os from bugfix/remove-l2-on-dlep…
HRogge Sep 14, 2020
b55f36d
Add json based import/export plugin for layer2 library
HRogge Sep 23, 2020
06b8343
Merge pull request #65 in FKIEA/oonf-os from feature/l2json to develop
HRogge Sep 23, 2020
e1e49c0
ANSN Check must be skipped if we reset the sequence number of a router
HRogge Jun 11, 2021
694a196
Merge pull request #66 in FKIEA/oonf-os from bugfix/fix_ansn_check to…
HRogge Jun 11, 2021
238c253
revert commit e1e49c0496be459f93e1508ff068ae5018622253
HRogge Jun 11, 2021
1904ed9
Merge pull request #67 in FKIEA/oonf-os from revert-bugfix to develop
HRogge Jun 11, 2021
7965956
Allow double-slash prefix for auto-quit telnet commands without comma…
HRogge Aug 18, 2021
bc4d842
Merge pull request #68 in FKIEA/oonf-os from feature/double-slash-tel…
HRogge Aug 18, 2021
6df2af0
Add atomic replacement for origin to l2json import
HRogge Aug 18, 2021
6980287
Merge pull request #69 in FKIEA/oonf-os from feature/l2import-replace…
HRogge Aug 18, 2021
fc1ee64
Fix some errors (most likely GCC changes) and disable DNS plugins for…
HRogge Sep 28, 2021
88eb288
Pull request #72: Fix some errors (most likely GCC changes) and disab…
HRogge Sep 28, 2021
919aea8
ignore not yet implemented TLV 20
JeremiasHo Oct 22, 2021
9090034
peer update fix for MTU TLV
JeremiasHo Oct 22, 2021
8571f73
Merge pull request #35 from JeremiasHo/patch-1
mathiashro Aug 25, 2022
1cec9b2
Merge pull request #36 from JeremiasHo/patch-2
mathiashro Aug 25, 2022
3d60692
Fix #41: Use correct interface for establishing DLEP TCP session
XDjackieXD Feb 5, 2023
04b2c9a
Fix openwrt buildscript plugins
XDjackieXD Feb 5, 2023
fbea183
Fix lan_import plugin build
XDjackieXD Mar 6, 2023
571afe7
Merge pull request #62 from XDjackieXD/fix_lan_import_build
mathiashro Nov 6, 2023
a82ecdb
Merge pull request #55 from XDjackieXD/develop
mathiashro Nov 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
project (OONF C)

###########################
#### API configuration ####
Expand Down
6 changes: 5 additions & 1 deletion apps/dlep-radio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@ set (OONF_APP_DEFAULT_CFG_HANDLER Compact)

IF (NOT OONF_STATIC_PLUGINS)
set (OONF_STATIC_PLUGINS class
callback
clock
layer2
packet_socket
socket
stream_socket
telnet
http
timer
viewer
os_clock
Expand All @@ -44,9 +46,11 @@ IF (NOT OONF_STATIC_PLUGINS)
cfg_compact
layer2info
systeminfo
remotecontrol
layer2_config
layer2_import
dlep_radio
layer2_export
dlep
)
ENDIF (NOT OONF_STATIC_PLUGINS)

Expand Down
8 changes: 7 additions & 1 deletion apps/dlep-router/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@ set (OONF_APP_DEFAULT_CFG_HANDLER Compact)

IF (NOT OONF_STATIC_PLUGINS)
set (OONF_STATIC_PLUGINS class
callback
clock
layer2
packet_socket
socket
stream_socket
telnet
http
timer
viewer
os_clock
Expand All @@ -44,8 +46,12 @@ IF (NOT OONF_STATIC_PLUGINS)
cfg_compact
layer2info
systeminfo
dlep_router
remotecontrol
layer2_config
layer2_export
# dns_query
# dns_sd
dlep
)
ENDIF (NOT OONF_STATIC_PLUGINS)

Expand Down
12 changes: 10 additions & 2 deletions apps/olsrd2-dlep/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ set (OONF_APP_DEFAULT_CFG_HANDLER Compact)

IF (NOT OONF_STATIC_PLUGINS)
set (OONF_STATIC_PLUGINS class
callback
clock
duplicate_set
layer2
Expand All @@ -54,17 +55,24 @@ IF (NOT OONF_STATIC_PLUGINS)
olsrv2
olsrv2info
olsrv2_lan
olsrv2_old_lan
olsrv2_l2import
netjsoninfo
layer2_import
auto_ll4
http
dlep_router
mpr
remotecontrol
route_modifier
dlep
)
ENDIF (NOT OONF_STATIC_PLUGINS)


IF (NOT OONF_OPTIONAL_STATIC_PLUGINS)
set (OONF_OPTIONAL_STATIC_PLUGINS nl80211_listener)
set (OONF_OPTIONAL_STATIC_PLUGINS nl80211_listener
cfg_uciloader
)
ENDIF (NOT OONF_OPTIONAL_STATIC_PLUGINS)

##################################
Expand Down
2 changes: 2 additions & 0 deletions apps/olsrd2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ set (OONF_APP_DEFAULT_CFG_HANDLER Compact)

IF (NOT OONF_STATIC_PLUGINS)
set (OONF_STATIC_PLUGINS class
callback
clock
duplicate_set
layer2
Expand Down Expand Up @@ -62,6 +63,7 @@ IF (NOT OONF_STATIC_PLUGINS)
http
mpr
remotecontrol
route_modifier
)
ENDIF (NOT OONF_STATIC_PLUGINS)

Expand Down
78 changes: 78 additions & 0 deletions include/oonf/base/oonf_callback.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@

/*
* The olsr.org Optimized Link-State Routing daemon version 2 (olsrd2)
* Copyright (c) 2004-2015, the olsr.org team - see HISTORY file
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of olsr.org, olsrd nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* Visit http://www.olsr.org for more information.
*
* If you find this software useful feel free to make a donation
* to the project. For more information see the website or contact
* the copyright holders.
*
*/

/**
* @file
*/

#ifndef OONF_CALLBACK_H_
#define OONF_CALLBACK_H_

#include <oonf/oonf.h>
#include <oonf/libcommon/list.h>

/*! subsystem identifier */
#define OONF_CALLBACK_SUBSYSTEM "callback"

/**
* This struct defines callback that should be called as soon as
* the runtime returns to the mainloop.
*/
struct oonf_callback {
/*! node of callback list */
struct list_entity _node;

/*! name of this callback */
const char *name;

/**
* Callback when timer is triggered
* @param ptr pointer to timer instance that fired
*/
void (*cb_trigger)(struct oonf_callback *ptr);
};

EXPORT void oonf_callback_add(struct oonf_callback *cb);
EXPORT void oonf_callback_remove(struct oonf_callback *cb);
EXPORT void oonf_callback_walk(void);
EXPORT struct list_entity *oonf_callback_get_list(void);

#endif /* OONF_CALLBACK_H_ */
93 changes: 88 additions & 5 deletions include/oonf/base/oonf_class.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
#ifndef _OONF_CLASS_H
#define _OONF_CLASS_H

#include <oonf/libcommon/avl.h>
#include <oonf/oonf.h>
#include <oonf/libcommon/avl.h>
#include <oonf/libcommon/list.h>

/*! subsystem identifier */
Expand Down Expand Up @@ -76,6 +76,44 @@ struct oonf_objectkey_str {
char buf[128];
};

/* storage data for a custom guard */
struct oonf_class_guard {
const char *name;
uint32_t id;
};

enum {
OONF_CLASS_GUARD1 = 0x13572468,
OONF_CLASS_GUARD2 = 0x75318642
};

/**
* Prefix to check data for overwriting and type error
*/
struct oonf_class_guard_prefix {
uint32_t id;
uint32_t guard1;
};

#ifdef OONF_LOG_DEBUG_INFO
#define OONF_CLASS_GUARD_PREFIX struct oonf_class_guard_prefix __guard_prefix;
#else
#define OONF_CLASS_GUARD_PREFIX
#endif

/**
* Suffix to check data for overwriting
*/
struct oonf_class_guard_suffix {
uint32_t guard2;
};

#ifdef OONF_LOG_DEBUG_INFO
#define OONF_CLASS_GUARD_SUFFIX struct oonf_class_guard_suffix __guard_suffix;
#else
#define OONF_CLASS_GUARD_SUFFIX
#endif

/**
* This structure represents a class of memory object, each with the same size.
*/
Expand Down Expand Up @@ -124,6 +162,12 @@ struct oonf_class {

/*! Stats, recycled memory blocks */
uint32_t _recycled;

/*! track debug status of class */
bool debug;

/* guard for debugging */
struct oonf_class_guard class_guard;
};

/**
Expand Down Expand Up @@ -174,6 +218,9 @@ EXPORT void oonf_class_remove(struct oonf_class *);

EXPORT void *oonf_class_malloc(struct oonf_class *) __attribute__((warn_unused_result));
EXPORT void oonf_class_free(struct oonf_class *, void *);
EXPORT void oonf_class_check(struct oonf_class *ci, void *ptr);

EXPORT void oonf_class_guard_add(struct oonf_class_guard *);

EXPORT int oonf_class_extension_add(struct oonf_class_extension *);
EXPORT void oonf_class_extension_remove(struct oonf_class_extension *);
Expand Down Expand Up @@ -232,11 +279,7 @@ oonf_class_get_extension(struct oonf_class_extension *ext, void *ptr) {
/**
* @param ext extension data structure
* @param ptr pointer to extension block
<<<<<<< HEAD
* @return pointer to base memory block
=======
* @return pointer to extensions base block
>>>>>>> mpr_rework
*/
static INLINE void *
oonf_class_get_base(struct oonf_class_extension *ext, void *ptr) {
Expand All @@ -252,4 +295,44 @@ oonf_class_is_extension_registered(struct oonf_class_extension *ext) {
return list_is_node_added(&ext->_node);
}

#ifdef OONF_LOG_DEBUG_INFO
#define oonf_class_guard_init(guard, base) oonf_class_guard_init_ext(guard, &(base)->__guard_prefix, &(base)->__guard_suffix)

static INLINE void
oonf_class_guard_init_ext(struct oonf_class_guard *guard,
struct oonf_class_guard_prefix *prefix, struct oonf_class_guard_suffix *suffix) {
prefix->guard1 = OONF_CLASS_GUARD1;
prefix->id = guard->id;
suffix->guard2 = OONF_CLASS_GUARD2;
}

#define oonf_class_guard_is_valid(guard, base) oonf_class_guard_is_valid_ext(guard, &(base)->__guard_prefix, &(base)->__guard_suffix)
#define OONF_CLASS_GUARD_ASSERT(guard, base, logging) OONF_ASSERT(oonf_class_guard_is_valid(guard, base), logging, "%s (%u) guard is bad (id=%u, guard1=%08x, guard2=%08x)", (guard)->name, (guard)->id, (base)->__guard_prefix.id, (base)->__guard_prefix.guard1, (base)->__guard_suffix.guard2)

static INLINE bool
oonf_class_guard_is_valid_ext(struct oonf_class_guard *guard,
struct oonf_class_guard_prefix *prefix, struct oonf_class_guard_suffix *suffix) {
return prefix->guard1 == OONF_CLASS_GUARD1
&& suffix->guard2 == OONF_CLASS_GUARD2
&& prefix->id == guard->id;
}
#else /* OONF_LOG_DEBUG_INFO */
#define oonf_class_guard_init(guard, base) do {} while(0)
static INLINE void
oonf_class_guard_init_ext(struct oonf_class_guard *guard __attribute__((unused)),
struct oonf_class_guard_prefix *prefix __attribute__((unused)),
struct oonf_class_guard_suffix *suffix __attribute__((unused))) {
}
#define oonf_class_guard_is_valid(guard, base) true
#define OONF_CLASS_GUARD_ASSERT(guard, ptr, logging) do {} while(0)

static INLINE bool
oonf_class_guard_is_valid_ext(struct oonf_class_guard *guard __attribute__((unused)),
struct oonf_class_guard_prefix *prefix __attribute__((unused)),
struct oonf_class_guard_suffix *suffix __attribute__((unused))) {
return true;
}

#endif /* OONF_LOG_DEBUG_INFO */

#endif /* _OONF_CLASS_H */
18 changes: 15 additions & 3 deletions include/oonf/base/oonf_clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,27 @@ EXPORT uint64_t oonf_clock_getNow(void);
EXPORT const char *oonf_clock_toClockString(struct isonumber_str *, uint64_t);

/**
* Converts an internal time value into a string representation with
* Converts an internal time interval into a string representation with
* the numbers of seconds (including milliseconds as fractions)
* @param buf target buffer
* @param i time value
* @return pointer to string representation
*/
static INLINE const char *
oonf_clock_toIntervalString_ext(struct isonumber_str *buf, int64_t i, bool raw) {
return isonumber_from_s64(buf, i, "", 1000, raw);
}

/**
* Converts an internal time interval into a string representation with
* the numbers of seconds (including milliseconds as fractions)
* @param buf target buffer
* @param i time value
* @return pointer to string representation
*/
static INLINE const char *
oonf_clock_toIntervalString(struct isonumber_str *buf, int64_t i) {
return isonumber_from_s64(buf, i, "", 1000, true);
return oonf_clock_toIntervalString_ext(buf, i, false);
}

/**
Expand All @@ -200,7 +212,7 @@ oonf_clock_fromIntervalString(uint64_t *result, const char *string) {
int64_t t;
int r;

r = isonumber_to_s64(&t, string, 1000);
r = isonumber_to_s64(&t, string, NULL, 1000);
if (r == 0) {
*result = t;
}
Expand Down
2 changes: 1 addition & 1 deletion include/oonf/base/oonf_duplicate_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
#ifndef OONF_DUPLICATE_SET_H_
#define OONF_DUPLICATE_SET_H_

#include <oonf/libcommon/avl.h>
#include <oonf/oonf.h>
#include <oonf/libcommon/avl.h>
#include <oonf/libcommon/netaddr.h>
#include <oonf/base/oonf_timer.h>

Expand Down
2 changes: 1 addition & 1 deletion include/oonf/base/oonf_http.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
#ifndef OONF_HTTP_H_
#define OONF_HTTP_H_

#include <oonf/libcommon/avl.h>
#include <oonf/oonf.h>
#include <oonf/libcommon/avl.h>
#include <oonf/libcommon/netaddr.h>
#include <oonf/libcommon/netaddr_acl.h>
#include <oonf/libcommon/string.h>
Expand Down
Loading