Libu2f-emu  0.0.0
Universal 2nd Factor (U2F) Emulation C Library
Functions | Variables
transport.c File Reference
#include <stdlib.h>
#include "transport.h"
#include "usb/usb.h"
#include "apdu/apdu.h"
Include dependency graph for transport.c:

Functions

const transport_info_ttransport_info_get (u2f_emu_transport type)
 Get the transport info for a specific transport type. More...
 
const struct transporttransport_get (const struct transport_core *core, u2f_emu_transport type)
 Get a transport from a transport core. More...
 
void transport_core_free (struct transport_core *core)
 Free all ressource allocated by a transport core. More...
 
bool transport_core_new (u2f_emu_vdev *vdev, struct transport_core **core_ref)
 Create a new transport_core that manage all transports. More...
 

Variables

static const transport_info_ttransports_info []
 Transports availables for U2F. More...
 
static const size_t transports_info_nb
 Number of transports availables for U2F. More...
 
struct transport_core __attribute__
 

Function Documentation

void transport_core_free ( struct transport_core *  core)

Free all ressource allocated by a transport core.

Parameters
coreThe transport core to free.
bool transport_core_new ( u2f_emu_vdev vdev,
struct transport_core **  core_ref 
)

Create a new transport_core that manage all transports.

Parameters
vdevThe virtual device.
core_refThe reference to the transport core to create.
Returns
Success: true. Failure: false.
const struct transport* transport_get ( const struct transport_core *  core,
u2f_emu_transport  type 
)

Get a transport from a transport core.

Parameters
coreThe transport core.
typeThe transport type.
Returns
Success: the transport. Failure: NULL.
const transport_info_t* transport_info_get ( u2f_emu_transport  type)

Get the transport info for a specific transport type.

Parameters
typeThe transport type.
Returns
Sucesss: The speccific transport info. Failure: NULL.

Variable Documentation

struct packet_cont __attribute__
const transport_info_t* transports_info[]
static
Initial value:
=
{
}
transport_info_t usb_transport
The USB transport.
Definition: usb.c:219
transport_info_t apdu_transport
The APDU transport.
Definition: apdu.c:98

Transports availables for U2F.

const size_t transports_info_nb
static
Initial value:
=
sizeof(transports_info) / sizeof(transports_info[0])
static const transport_info_t * transports_info[]
Transports availables for U2F.
Definition: transport.c:11

Number of transports availables for U2F.