21 #include "pedigree/kernel/Log.h" 22 #include "pedigree/kernel/utilities/Iterator.h" 23 #include "pedigree/kernel/utilities/utility.h" 38 if (level <= 4 && level > 0)
46 for (callbackIterator it = list->
begin(); it != list->
end(); ++it)
48 bool (*callback)(uintptr_t, size_t) =
49 reinterpret_cast<bool (*)(uintptr_t,
size_t)
>(*it);
50 bool result = callback(packet, sz);
64 size_t level,
bool (*callback)(uintptr_t,
size_t))
69 if (level <= 4 && level > 0)
78 size_t index = list->
count();
79 list->
pushBack(reinterpret_cast<void *>(callback));
89 "Ran out of memory creating list for level " 90 <<
Dec << level <<
Hex <<
" callbacks!");
91 return static_cast<size_t>(-1);
94 list->
pushBack(reinterpret_cast<void *>(callback));
103 return static_cast<size_t>(-1);
void pushBack(const T &value)
bool filter(size_t level, uintptr_t packet, size_t sz)
void removeCallback(size_t level, size_t id)
NetworkFilter()
Default constructor, boring.
void insert(const K &key, const E &value)
size_t installCallback(size_t level, bool(*callback)(uintptr_t, size_t))
Tree< size_t, List< void * > * > m_Callbacks
Level -> Callback list mapping.
virtual ~NetworkFilter()
Destructor, also boring.
E lookup(const K &key) const