/* -*-c-*-
*
- * $Id: socket.c,v 1.10 2003/11/25 14:08:23 mdw Exp $
+ * $Id: socket.c,v 1.11 2003/11/29 20:36:07 mdw Exp $
*
* Socket source and target definitions
*
/*----- Revision history --------------------------------------------------*
*
* $Log: socket.c,v $
+ * Revision 1.11 2003/11/29 20:36:07 mdw
+ * Privileged outgoing connections.
+ *
* Revision 1.10 2003/11/25 14:08:23 mdw
* Debianization. Socket target options. Internet binding.
*
dstr_destroy(&d);
}
+ /* --- Confirm the address --- */
+
+ if (ss->a->ops->confirm)
+ ss->a->ops->confirm(ss->a, ADDR_SRC, ss->ao);
+
/* --- Initialize the socket for listening --- */
if ((fd = ss->a->ops->bind(ss->a, ss->ao)) < 0)
return (&st->t);
}
-/* --- @create@ --- *
- *
- * Arguments: @target *t@ = pointer to target
- * @const char *desc@ = description of connection
- *
- * Returns: Pointer to a created endpoint.
- *
- * Use: Generates a target endpoint for communication.
- */
+/* --- @confirm@ --- */
+
+static void starget_confirm(target *t)
+{
+ starget *st = (starget *)t;
+
+ if (st->a->ops->confirm)
+ st->a->ops->confirm(st->a, ADDR_DEST, st->ao);
+}
+
+/* --- @create@ --- */
static endpt *starget_create(target *t, const char *desc)
{
target_ops starget_ops = {
"socket",
- starget_option, starget_read, starget_create, starget_destroy
+ starget_option, starget_read, starget_confirm,
+ starget_create, starget_destroy
};
/*----- That's all, folks -------------------------------------------------*/