5 * Copyright 2003, 2004 Porchdog Software, Inc. All rights reserved.
7 * Redistribution and use in source and binary forms, with or without modification,
8 * are permitted provided that the following conditions are met:
10 * 1. Redistributions of source code must retain the above copyright notice,
11 * this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright notice,
13 * this list of conditions and the following disclaimer in the documentation
14 * and/or other materials provided with the distribution.
16 * THIS SOFTWARE IS PROVIDED BY PORCHDOG SOFTWARE ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 * IN NO EVENT SHALL THE HOWL PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
20 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
23 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
24 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
25 * OF THE POSSIBILITY OF SUCH DAMAGE.
27 * The views and conclusions contained in the software and documentation are those
28 * of the authors and should not be interpreted as representing official policies,
29 * either expressed or implied, of Porchdog Software, Inc.
32 #include <salt/platform.h>
33 #include <salt/time.h>
42 typedef enum _sw_socket_event
44 SW_SOCKET_READ = (1 << 0),
45 SW_SOCKET_WRITE = (1 << 1),
46 SW_SOCKET_OOB = (1 << 2)
51 typedef struct _sw_salt * sw_salt;
54 struct _sw_network_interface;
57 typedef sw_opaque sw_socket_handler;
59 (HOWL_API *sw_socket_handler_func)(
60 sw_socket_handler handler,
62 struct _sw_socket * socket,
63 sw_socket_event events,
67 typedef sw_opaque sw_timer_handler;
69 (HOWL_API *sw_timer_handler_func)(
70 sw_timer_handler handler,
72 struct _sw_timer * timer,
76 typedef sw_opaque sw_network_interface_handler;
78 (HOWL_API *sw_network_interface_handler_func)(
79 sw_network_interface_handler handler,
81 struct _sw_network_interface * netif,
84 typedef sw_opaque sw_signal_handler;
86 (HOWL_API *sw_signal_handler_func)(
87 sw_signal_handler handler,
89 struct _sw_signal * signal,
106 sw_salt_register_socket(
108 struct _sw_socket * socket,
109 sw_socket_event events,
110 sw_socket_handler handler,
111 sw_socket_handler_func func,
116 sw_salt_unregister_socket(
118 struct _sw_socket * socket);
122 sw_salt_register_timer(
124 struct _sw_timer * timer,
126 sw_timer_handler handler,
127 sw_timer_handler_func func,
132 sw_salt_unregister_timer(
134 struct _sw_timer * timer);
138 sw_salt_register_network_interface(
140 struct _sw_network_interface * netif,
141 sw_network_interface_handler handler,
142 sw_network_interface_handler_func func,
147 sw_salt_unregister_network_interface_handler(
152 sw_salt_register_signal(
154 struct _sw_signal * signal,
155 sw_signal_handler handler,
156 sw_signal_handler_func func,
161 sw_salt_unregister_signal(
163 struct _sw_signal * signal);
200 #define SW_E_CORE_BASE 0x80000000
201 #define SW_E_UNKNOWN (SW_E_CORE_BASE) + 1
202 #define SW_E_INIT (SW_E_CORE_BASE) + 2
203 #define SW_E_MEM (SW_E_CORE_BASE) + 3
204 #define SW_E_EOF (SW_E_CORE_BASE) + 4
205 #define SW_E_NO_IMPL (SW_E_CORE_BASE) + 5
206 #define SW_E_FILE_LOCKED (SW_E_CORE_BASE) + 6
207 #define SW_E_PROTOCOL_NOT_FOUND (SW_E_CORE_BASE) + 7