-static errno_t sock_send_internal(socket_t, const struct msghdr *,
- mbuf_t, int, size_t *);
-static void sock_setupcalls_common(socket_t, sock_upcall, void *,
- sock_upcall, void *);
+static errno_t sock_send_internal(socket_t, const struct msghdr *,
+ mbuf_t, int, size_t *);
+
+#undef sock_accept
+#undef sock_socket
+errno_t sock_accept(socket_t so, struct sockaddr *from, int fromlen,
+ int flags, sock_upcall callback, void *cookie, socket_t *new_so);
+errno_t sock_socket(int domain, int type, int protocol, sock_upcall callback,
+ void *context, socket_t *new_so);
+
+static errno_t sock_accept_common(socket_t sock, struct sockaddr *from,
+ int fromlen, int flags, sock_upcall callback, void *cookie,
+ socket_t *new_sock, bool is_internal);
+static errno_t sock_socket_common(int domain, int type, int protocol,
+ sock_upcall callback, void *context, socket_t *new_so, bool is_internal);