* Copyright 2003-2004, Haiku Inc.
* Distributed under the terms of the MIT License.
*/
#ifndef _K_PPP_UTILS__H
#define _K_PPP_UTILS__H
#ifndef _K_PPP_DEFS__H
#include <KPPPDefs.h>
#endif
#include <OS.h>
class KPPPProtocol;
extern bool IsProtocolAllowed(const KPPPProtocol& protocol);
template<class _LIST, class _FUNCTION>
inline
void
ForEachItem(_LIST& list, _FUNCTION function)
{
for(int index = 0; index < list.CountItems(); index++)
function(list.ItemAt(index));
}
extern status_t send_data_with_timeout(thread_id thread, int32 code, void *buffer,
size_t buffer_size, uint32 timeout);
extern status_t receive_data_with_timeout(thread_id *sender, int32 *code,
void *buffer, size_t buffer_size, uint32 timeout);
#endif