TLS tolling modes efforts
This commit is contained in:
parent
a5d2d656c8
commit
862da68014
|
|
@ -278,6 +278,7 @@ static int transport_indication(facilities_t *facilities, void* responder, void*
|
||||||
tlsc = tolling_tlsc_new(&facilities->tolling, &facilities->epv, tpi->choice.tcp.sourceAddress->buf, 7011);
|
tlsc = tolling_tlsc_new(&facilities->tolling, &facilities->epv, tpi->choice.tcp.sourceAddress->buf, 7011);
|
||||||
id = tlsc->id;
|
id = tlsc->id;
|
||||||
}
|
}
|
||||||
|
++tlsc->nmsg;
|
||||||
pthread_mutex_unlock(&facilities->tolling.lock);
|
pthread_mutex_unlock(&facilities->tolling.lock);
|
||||||
sreq->choice.tlsSend.connId = id;
|
sreq->choice.tlsSend.connId = id;
|
||||||
|
|
||||||
|
|
@ -313,9 +314,8 @@ static int transport_indication(facilities_t *facilities, void* responder, void*
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Forward to [transport]
|
// Forward to [transport]
|
||||||
if (srep->data->choice.tlsRecv.initializing) {
|
if (srep->data->choice.tlsRecv.state != 1) {
|
||||||
tr = calloc(1, sizeof(TransportRequest_t));
|
tr = calloc(1, sizeof(TransportRequest_t));
|
||||||
tr->present = TransportRequest_PR_packet;
|
tr->present = TransportRequest_PR_packet;
|
||||||
tr->choice.packet.present = TransportPacketRequest_PR_tcp;
|
tr->choice.packet.present = TransportPacketRequest_PR_tcp;
|
||||||
|
|
|
||||||
|
|
@ -281,6 +281,7 @@ int tpm_pay(void* fc, tolling_info_t* info, void* security_socket, uint8_t* neig
|
||||||
tlsc = tolling_tlsc_new(tolling, &facilities->epv, dst_addr, 7011);
|
tlsc = tolling_tlsc_new(tolling, &facilities->epv, dst_addr, 7011);
|
||||||
id = tlsc->id;
|
id = tlsc->id;
|
||||||
}
|
}
|
||||||
|
++tlsc->nmsg;
|
||||||
sreq->choice.tlsSend.connId = id;
|
sreq->choice.tlsSend.connId = id;
|
||||||
|
|
||||||
buf[0] = 4;
|
buf[0] = 4;
|
||||||
|
|
@ -808,6 +809,7 @@ static void rsu_handle_recv(facilities_t* facilities, TPM_t* tpm_rx, void* secur
|
||||||
tlsc = tolling_tlsc_new(tolling, &facilities->epv, src_addr, 7011);
|
tlsc = tolling_tlsc_new(tolling, &facilities->epv, src_addr, 7011);
|
||||||
id = tlsc->id;
|
id = tlsc->id;
|
||||||
}
|
}
|
||||||
|
++tlsc->nmsg;
|
||||||
sreq->choice.tlsSend.connId = id;
|
sreq->choice.tlsSend.connId = id;
|
||||||
|
|
||||||
buf[0] = 4;
|
buf[0] = 4;
|
||||||
|
|
@ -849,8 +851,7 @@ static void rsu_handle_recv(facilities_t* facilities, TPM_t* tpm_rx, void* secur
|
||||||
tcp->data.size = srep->data->choice.tlsSend.data.size;
|
tcp->data.size = srep->data->choice.tlsSend.data.size;
|
||||||
memcpy(tcp->data.buf, srep->data->choice.tlsSend.data.buf, srep->data->choice.tlsSend.data.size);
|
memcpy(tcp->data.buf, srep->data->choice.tlsSend.data.buf, srep->data->choice.tlsSend.data.size);
|
||||||
|
|
||||||
if (tolling->protocol.p == TOLLING_PROTOCOL_TLS_GN ||
|
if (tolling->protocol.p == TOLLING_PROTOCOL_TLS_GN) {
|
||||||
tolling->protocol.p == TOLLING_PROTOCOL_TLS_SHS) {
|
|
||||||
tcp->gn = calloc(1, sizeof(GeonetworkingOutboundOptions_t));
|
tcp->gn = calloc(1, sizeof(GeonetworkingOutboundOptions_t));
|
||||||
tcp->gn->packetTransportType = PacketTransportType_shb;
|
tcp->gn->packetTransportType = PacketTransportType_shb;
|
||||||
tcp->gn->destinationAddress.buf = calloc(1, 6);
|
tcp->gn->destinationAddress.buf = calloc(1, 6);
|
||||||
|
|
@ -1301,6 +1302,8 @@ tlsc_t* tolling_tlsc_new(tolling_t* tolling, itss_epv_t* epv, uint8_t ipv6[16],
|
||||||
tlsc->port = port;
|
tlsc->port = port;
|
||||||
tlsc->id = rand();
|
tlsc->id = rand();
|
||||||
tlsc->ts = itss_time_get(epv);
|
tlsc->ts = itss_time_get(epv);
|
||||||
|
tlsc->nmsg = 0;
|
||||||
|
tlsc->state = 0;
|
||||||
++tolling->protocol.c.tls.n_tlsc;
|
++tolling->protocol.c.tls.n_tlsc;
|
||||||
return tlsc;
|
return tlsc;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue