Call each comm's clientinfo_fn on the comm-info dict, if any.
Pass the resulting struct clientinfo to sendmsg.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
should be reflected in the local private interface MTU, ie the mtu
parameter to netlink). If this parameter is not set, or is set
to 0, the default is to use the local private link mtu.
should be reflected in the local private interface MTU, ie the mtu
parameter to netlink). If this parameter is not set, or is set
to 0, the default is to use the local private link mtu.
+ comm-info (dict): Information for the comm, used when this site
+ wants to transmit. If the comm does not support this, it is
+ ignored. (Currently nothing uses this.)
Links involving mobile peers have some different tuning parameter
default values, which are generally more aggressive about retrying key
Links involving mobile peers have some different tuning parameter
default values, which are generally more aggressive about retrying key
uint32_t mtu_target;
struct netlink_if *netlink;
struct comm_if **comms;
uint32_t mtu_target;
struct netlink_if *netlink;
struct comm_if **comms;
+ struct comm_clientinfo **commclientinfos;
int ncomms;
struct resolver_if *resolver;
struct log_if *log;
int ncomms;
struct resolver_if *resolver;
struct log_if *log;
const struct comm_addr *dest,
struct buffer_if *buf)
{
const struct comm_addr *dest,
struct buffer_if *buf)
{
- return dest->comm->sendmsg(dest->comm->st, buf, dest, 0);
+ int i;
+ struct comm_clientinfo *commclientinfo = 0;
+
+ for (i=0; i < st->ncomms; i++) {
+ if (st->comms[i] == dest->comm) {
+ commclientinfo = st->commclientinfos[i];
+ break;
+ }
+ }
+ return dest->comm->sendmsg(dest->comm->st, buf, dest, commclientinfo);
}
static uint32_t site_status(void *st)
}
static uint32_t site_status(void *st)
GET_CLOSURE_LIST("comm",comms,ncomms,CL_COMM);
GET_CLOSURE_LIST("comm",comms,ncomms,CL_COMM);
+ NEW_ARY(st->commclientinfos, st->ncomms);
+ dict_t *comminfo = dict_read_dict(dict,"comm-info",False,"site",loc);
+ for (i=0; i<st->ncomms; i++) {
+ st->commclientinfos[i] =
+ !comminfo ? 0 :
+ st->comms[i]->clientinfo(st->comms[i],comminfo,loc);
+ }
+
st->resolver=find_cl_if(dict,"resolver",CL_RESOLVER,True,"site",loc);
st->log=find_cl_if(dict,"log",CL_LOG,True,"site",loc);
st->random=find_cl_if(dict,"random",CL_RANDOMSRC,True,"site",loc);
st->resolver=find_cl_if(dict,"resolver",CL_RESOLVER,True,"site",loc);
st->log=find_cl_if(dict,"log",CL_LOG,True,"site",loc);
st->random=find_cl_if(dict,"random",CL_RANDOMSRC,True,"site",loc);