Changeset View
Changeset View
Standalone View
Standalone View
sys/net/route/nhop_utils.h
Show First 20 Lines • Show All 133 Lines • ▼ Show 20 Lines | |||||
} while(0) | } while(0) | ||||
#define CHT_SLIST_REMOVE_BYOBJ CHT_SLIST_REMOVE | #define CHT_SLIST_REMOVE_BYOBJ CHT_SLIST_REMOVE | ||||
#define CHT_SLIST_FOREACH(_head, _PX, _x) \ | #define CHT_SLIST_FOREACH(_head, _PX, _x) \ | ||||
for (uint32_t _i = 0; _i < (_head)->hash_size; _i++) { \ | for (uint32_t _i = 0; _i < (_head)->hash_size; _i++) { \ | ||||
for (_x = CHT_FIRST(_head, _i); _x; _x = _PX##_next(_x)) | for (_x = CHT_FIRST(_head, _i); _x; _x = _PX##_next(_x)) | ||||
#define CHT_SLIST_FOREACH_END } | #define CHT_SLIST_FOREACH_END } | ||||
#define CHT_SLIST_FOREACH_SAFE(_head, _PX, _x, _t) \ | |||||
for (uint32_t _i = 0; _i < (_head)->hash_size; _i++) { \ | |||||
for (_x = CHT_FIRST(_head, _i); (_x) && (_t = _PX##_next(_x)); _x = _t) | |||||
#define CHT_SLIST_FOREACH_SAFE_END } | |||||
#define CHT_SLIST_RESIZE(_head, _PX, _new_void_ptr, _new_hsize) \ | #define CHT_SLIST_RESIZE(_head, _PX, _new_void_ptr, _new_hsize) \ | ||||
uint32_t _new_idx; \ | uint32_t _new_idx; \ | ||||
typeof((_head)->ptr) _new_ptr = (void *)_new_void_ptr; \ | typeof((_head)->ptr) _new_ptr = (void *)_new_void_ptr; \ | ||||
typeof(*(_head)->ptr) _x, _y; \ | typeof(*(_head)->ptr) _x, _y; \ | ||||
for (uint32_t _old_idx = 0; _old_idx < (_head)->hash_size; _old_idx++) {\ | for (uint32_t _old_idx = 0; _old_idx < (_head)->hash_size; _old_idx++) {\ | ||||
_x = CHT_FIRST(_head, _old_idx); \ | _x = CHT_FIRST(_head, _old_idx); \ | ||||
_y = _x; \ | _y = _x; \ | ||||
while (_y != NULL) { \ | while (_y != NULL) { \ | ||||
Show All 30 Lines |