Commit 0eab7f8a authored by Pekka Pessi's avatar Pekka Pessi

Added tpac_address field to the stack interface.

The function tpac_address is called whenever tport detects that its
addresses has changed.

darcs-hash:20060223201957-65a35-614c717f4fb1da1dd6329b517f522c68d0e19ece.gz
parent 148eb5bf
......@@ -102,6 +102,9 @@ typedef struct {
/** Ask stack to accept/reject early SigComp message */
int (*tpac_sigcomp_accept)(tp_stack_t *, tport_t *, msg_t *);
/** Indicate stack that address has changed */
void (*tpac_address)(tp_stack_t *, tport_t *);
} tport_stack_class_t;
/* Compatibility */
......@@ -119,16 +122,19 @@ enum {
/* AI extension flags - these must not overlap with existing AI flags. */
/** Message is to be sent/received compressed */
#define TP_AI_COMPRESSED 0x1000
#define TP_AI_COMPRESSED 0x01000
/** Message is to be sent/received on secure connection */
#define TP_AI_SECURE 0x02000
/** Halfclose (shutdown(c, 1)) connection after sending message */
#define TP_AI_SHUTDOWN 0x2000
#define TP_AI_SHUTDOWN 0x04000
/** Close connection (shutdown(c, 2)) after sending message */
#define TP_AI_CLOSE 0x4000
#define TP_AI_CLOSE 0x08000
/** Address was inaddr_any */
#define TP_AI_ANY 0x8000
#define TP_AI_ANY 0x80000
#define TP_AI_MASK 0xf000
#define TP_AI_MASK 0xff000
/** Maximum size of a @e host:port string, including final NUL. */
#define TPORT_HOSTPORTSIZE (55)
......
......@@ -630,11 +630,14 @@ static int init_test(tp_test_t *tt)
for (tp = tport_primaries(tt->tt_srv_tports); tp; tp = tport_next(tp)) {
TEST_1(tpn = tport_name(tp));
if (1 || tt->tt_flags & tst_verbatim)
printf("bound transport to %s/%s:%s;maddr=%s%s%s\n",
tpn->tpn_proto, tpn->tpn_canon, tpn->tpn_port, tpn->tpn_host,
if (1 || tt->tt_flags & tst_verbatim) {
char const *host = tpn->tpn_host != tpn->tpn_canon ? tpn->tpn_host : "";
printf("bound transport to %s/%s:%s%s%s%s%s\n",
tpn->tpn_proto, tpn->tpn_canon, tpn->tpn_port,
host[0] ? ";maddr=" : "", host,
tpn->tpn_comp ? ";comp=" : "",
tpn->tpn_comp ? tpn->tpn_comp : "");
}
/* Ignore server2 tports for now */
if (strcmp(tpn->tpn_ident, "server"))
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment