29#include <sys/socket.h>
32#define SCION_SO_DEBUG 200
34#define SCION_FETCH_OPT_DEBUG 1
39#define SCION_IA_STRLEN 21
191 SCION_ERR_NOT_ENOUGH_DATA = -201,
192 SCION_ERR_PACKET_FIELD_INVALID = -202,
193 SCION_ERR_GRPC_FAIL = -203,
194 SCION_ERR_META_HDR_INVALID = -204,
195 SCION_ERR_PATH_TYPE_INVALID = -205,
196 SCION_ERR_SCMP_CODE_INVALID = -206,
370#define SCION_PATH_METADATA_LATENCY_IS_UNSET(latency) (latency.tv_sec == 0 && latency.tv_usec == -1)
375#define SCION_PATH_METADATA_BANDWIDTH_IS_UNSET(bandwidth) (bandwidth == 0)
380#define SCION_PATH_METADATA_GEO_IS_UNSET(geo) (geo.latitude == NAN && geo.longitude == NAN && geo.address == NULL)
385#define SCION_PATH_METADATA_INTERNAL_HOPS_IS_UNSET(internal_hops) (internal_hops == 0)
466 size_t interfaces_len;
826 const struct sockaddr *dst_addr, socklen_t addrlen,
scion_ia dst_ia,
struct scion_path *path);
const struct scion_policy scion_policy_least_hops
int scion_scmp_echo_deserialize(const uint8_t *buf, uint16_t buf_len, struct scion_scmp_echo *scmp_echo)
int scion_scmp_echo_serialize(const struct scion_scmp_echo *scmp_echo, uint8_t *buf, uint16_t buf_len)
const struct scion_path_metadata * scion_path_get_metadata(const struct scion_path *path)
int scion_setsockerrcb(struct scion_socket *scion_sock, scion_socket_scmp_error_cb cb, void *ctx)
void scion_ia_print(scion_ia ia)
int scion_setsockopt(struct scion_socket *scion_sock, int level, int optname, const void *optval, socklen_t optlen)
struct scion_policy scion_policy_min_mtu(uint32_t *mtu)
const struct scion_policy scion_policy_highest_mtu
void scion_addr_print(const struct sockaddr *addr, scion_ia ia)
ssize_t scion_recvfrom(struct scion_socket *scion_sock, void *buf, size_t size, int flags, struct sockaddr *src_addr, socklen_t *addrlen, scion_ia *src_ia, struct scion_path **path)
int scion_getsockname(struct scion_socket *scion_sock, struct sockaddr *addr, socklen_t *addrlen, scion_ia *ia)
scion_scmp_echo_type
Definition scion.h:973
@ SCION_ECHO_TYPE_REQUEST
Definition scion.h:979
@ SCION_ECHO_TYPE_REPLY
Definition scion.h:985
void scion_path_free(struct scion_path *path)
ssize_t scion_send(struct scion_socket *scion_sock, const void *buf, size_t size, int flags)
int scion_getsockfd(struct scion_socket *scion_sock, int *fd)
int scion_bind(struct scion_socket *scion_sock, const struct sockaddr *addr, socklen_t addrlen)
uint8_t scion_scmp_get_code(const uint8_t *buf, uint16_t buf_len)
int scion_ia_str(scion_ia ia, char *buf, size_t buflen)
void scion_network_free(struct scion_network *net)
void scion_socket_scmp_error_cb(uint8_t *buf, size_t size, void *ctx)
Definition scion.h:762
void scion_topology_free(struct scion_topology *topo)
void scion_path_collection_free(struct scion_path_collection *paths)
int scion_path_reverse(struct scion_path *path)
scion_proto
Definition scion.h:223
@ SCION_PROTO_SCMP
Definition scion.h:233
@ SCION_PROTO_UDP
Definition scion.h:228
const struct scion_policy scion_policy_highest_bandwidth
void scion_path_print_metadata(const struct scion_path *path)
size_t scion_path_get_numhops(const struct scion_path *path)
void scion_path_collection_sort(struct scion_path_collection *paths, struct scion_path_comparator comparator)
char * scion_strerror(int err)
scion_error
Definition scion.h:46
@ SCION_ERR_NETWORK_ADDR_FAMILY_MISMATCH
Definition scion.h:90
@ SCION_ERR_DST_MISMATCH
Definition scion.h:104
@ SCION_ERR_MAX_HDR_LEN_EXCEEDED
Definition scion.h:72
@ SCION_ERR_RECV_FAIL
Definition scion.h:136
@ SCION_ERR_ADDR_FAMILY_UNKNOWN
Definition scion.h:68
@ SCION_ERR_ADDR_BUF_TOO_SMALL
Definition scion.h:162
@ SCION_ERR_BUF_TOO_SMALL
Definition scion.h:62
@ SCION_ERR_ALREADY_BOUND
Definition scion.h:120
@ SCION_ERR_PROTO_UNKNOWN
Definition scion.h:96
@ SCION_ERR_INVALID_ISD_AS_STR
Definition scion.h:108
@ SCION_ERR_ADDR_IN_USE
Definition scion.h:142
@ SCION_ERR_NOT_BOUND
Definition scion.h:170
@ SCION_ERR_ADDR_NOT_AVAILABLE
Definition scion.h:148
@ SCION_ERR_NETWORK_UNKNOWN
Definition scion.h:174
@ SCION_ERR_TOPOLOGY_INVALID
Definition scion.h:80
@ SCION_ERR_ADDR_FAMILY_MISMATCH
Definition scion.h:86
@ SCION_ERR_BOOTSTRAPPING_FAIL
Definition scion.h:189
@ SCION_ERR_SRC_ADDR_UNKNOWN
Definition scion.h:185
@ SCION_ERR_NOT_CONNECTED
Definition scion.h:100
@ SCION_ERR_OUTPUT_QUEUE_FULL
Definition scion.h:154
@ SCION_ERR_MEM_ALLOC_FAIL
Definition scion.h:54
@ SCION_ERR_MSG_TOO_LARGE
Definition scion.h:178
@ SCION_ERR_GENERIC
Definition scion.h:50
@ SCION_ERR_PATH_EXPIRED
Definition scion.h:166
@ SCION_ERR_FILE_NOT_FOUND
Definition scion.h:76
@ SCION_ERR_FLAG_NOT_IMPLEMENTED
Definition scion.h:124
@ SCION_ERR_FLAG_NOT_SUPPORTED
Definition scion.h:128
@ SCION_ERR_SEND_FAIL
Definition scion.h:132
@ SCION_ERR_SOCK_OPT_INVALID
Definition scion.h:158
@ SCION_ERR_WOULD_BLOCK
Definition scion.h:112
@ SCION_ERR_NO_PATHS
Definition scion.h:58
@ SCION_ERR_ADDR_INVALID
Definition scion.h:116
struct scion_path * scion_path_collection_first(struct scion_path_collection *paths)
uint16_t scion_scmp_echo_len(struct scion_scmp_echo *scmp_echo)
uint64_t scion_ifid
Definition scion.h:390
int scion_setsockpolicy(struct scion_socket *scion_sock, struct scion_policy policy)
bool(* scion_path_predicate_fn)(struct scion_path *path, void *ctx)
Definition scion.h:559
void(* scion_policy_fn)(struct scion_path_collection *paths, void *ctx)
Definition scion.h:703
scion_addr_family
Definition scion.h:209
@ SCION_AF_INET
Definition scion.h:213
@ SCION_AF_INET6
Definition scion.h:217
scion_ia scion_topology_get_local_ia(struct scion_topology *topo)
int(* scion_path_comparator_fn)(struct scion_path *path_one, struct scion_path *path_two, void *ctx)
Definition scion.h:586
uint64_t scion_ia
Definition scion.h:239
enum scion_addr_family scion_network_get_local_addr_family(struct scion_network *net)
int scion_topology_from_file(struct scion_topology **topology, const char *path)
uint8_t scion_scmp_get_type(const uint8_t *buf, uint16_t buf_len)
int scion_ia_parse(const char *str, size_t len, scion_ia *ia)
ssize_t scion_recv(struct scion_socket *scion_sock, void *buf, size_t size, int flags)
void scion_path_print(const struct scion_path *path)
int scion_path_collection_fetch(struct scion_network *network, scion_ia dst, uint opt, struct scion_path_collection **paths)
struct scion_path * scion_path_collection_pop(struct scion_path_collection *paths)
int scion_close(struct scion_socket *scion_sock)
int scion_getsockopt(struct scion_socket *scion_sock, int level, int optname, void *optval, socklen_t *optlen)
void scion_scmp_echo_free_members(struct scion_scmp_echo *scmp_echo)
int scion_bootstrap(const char *topology_output_path)
bool scion_scmp_is_error(const uint8_t *buf, uint16_t buf_len)
struct scion_path ** scion_path_collection_as_array(struct scion_path_collection *paths, size_t *len)
int scion_connect(struct scion_socket *scion_sock, const struct sockaddr *addr, socklen_t addrlen, scion_ia ia)
size_t scion_path_collection_size(struct scion_path_collection *paths)
scion_link_type
Definition scion.h:431
@ SCION_LINK_TYPE_OPEN_NET
Definition scion.h:447
@ SCION_LINK_TYPE_MULTI_HOP
Definition scion.h:443
@ SCION_LINK_TYPE_DIRECT
Definition scion.h:439
@ SCION_LINK_TYPE_UNSPECIFIED
Definition scion.h:435
const struct scion_policy scion_policy_lowest_latency
void scion_path_collection_filter(struct scion_path_collection *paths, struct scion_path_predicate predicate)
void scion_path_collection_print(struct scion_path_collection *paths)
struct scion_path * scion_path_collection_find(struct scion_path_collection *paths, struct scion_path_predicate predicate)
ssize_t scion_sendto(struct scion_socket *scion_sock, const void *buf, size_t size, int flags, const struct sockaddr *dst_addr, socklen_t addrlen, scion_ia dst_ia, struct scion_path *path)
The geographic location of an AS.
Definition scion.h:413
float latitude
Definition scion.h:417
float longitude
Definition scion.h:421
char * address
Definition scion.h:425
A network context in SCION.
A collection of SCION paths.
A path comparator.
Definition scion.h:593
bool ascending
Definition scion.h:605
scion_path_comparator_fn fn
Definition scion.h:597
void * ctx
Definition scion.h:601
An interface of an AS in a SCION path.
Definition scion.h:397
scion_ifid id
Definition scion.h:401
scion_ia ia
Definition scion.h:405
A path predicate.
Definition scion.h:566
void * ctx
Definition scion.h:574
scion_path_predicate_fn fn
Definition scion.h:570
void * ctx
Definition scion.h:717
scion_policy_fn fn
Definition scion.h:712
uint16_t data_length
Definition scion.h:1001
uint8_t * data
Definition scion.h:999
uint16_t id
Definition scion.h:995
uint16_t seqno
Definition scion.h:997
enum scion_scmp_echo_type type
Definition scion.h:993
A topology context in SCION.