First pass at fragmenting
This commit is contained in:
@@ -13,11 +13,15 @@
|
||||
#define MAX_RLOCS 64
|
||||
#define MAX_EID_MAPPINGS 256
|
||||
|
||||
// Just a guess, but 20-byte IP header, 16-byte IV, 16-byte tag, 16 bytes for symmetric block padding
|
||||
#define DEFAULT_PATH_MTU 1500 - ( 20 + 16 + 16 + 16 )
|
||||
|
||||
struct key_context {
|
||||
struct peer_context {
|
||||
int in_use;
|
||||
char secret[SHA256_DIGEST_LENGTH];
|
||||
EVP_CIPHER_CTX ctx;
|
||||
|
||||
unsigned int path_mtu;
|
||||
|
||||
/* Probably don't need these
|
||||
struct rloc *rloc_x;
|
||||
@@ -35,6 +39,7 @@ struct rloc {
|
||||
EVP_PKEY *key;
|
||||
// We use this to index our rloc for shared keys
|
||||
int context_id;
|
||||
char presentation[128];
|
||||
};
|
||||
|
||||
|
||||
@@ -72,7 +77,7 @@ struct rlocs {
|
||||
* Half of the allocated memory goes unused, but we can worry about dynamic
|
||||
* allocation at the same time as MAX_RLOCS and MAX_EID_MAPPINGS
|
||||
*/
|
||||
struct key_context key_contexts[MAX_RLOCS][MAX_RLOCS];
|
||||
struct peer_context peer_contexts[MAX_RLOCS][MAX_RLOCS];
|
||||
};
|
||||
|
||||
|
||||
@@ -84,6 +89,12 @@ struct rloc *rloc_find_for_ipv4( struct rlocs *reg, struct in_addr *eid );
|
||||
struct rloc *rloc_find_for_ipv6( struct rlocs *reg, struct in6_addr *eid );
|
||||
struct rloc *rloc_find_by_address( struct rlocs *reg, struct in_addr *ipv4, struct in6_addr *ipv6 );
|
||||
|
||||
int rlocs_find_two_ipv4(
|
||||
struct rlocs *reg,
|
||||
struct rloc **s_rloc_ptr, struct in_addr *s_rloc_addr,
|
||||
struct rloc **d_rloc_ptr, struct in_addr *d_rloc_addr
|
||||
);
|
||||
|
||||
int rloc_add_private_key( struct rloc *rloc, char *filename );
|
||||
|
||||
void rlocs_debug_output( struct rlocs *reg );
|
||||
@@ -92,6 +103,9 @@ void rlocs_debug_output( struct rlocs *reg );
|
||||
ssize_t rlocs_encrypt( struct rlocs *reg, struct rloc *x, struct rloc *y, unsigned char *data, size_t data_len, unsigned char *dest, size_t dest_len );
|
||||
ssize_t rlocs_decrypt( struct rlocs *reg, struct rloc *x, struct rloc *y, unsigned char *data, size_t data_len, unsigned char *dest, size_t dest_len );
|
||||
|
||||
unsigned short rlocs_get_path_mtu( struct rlocs *reg, struct rloc *x, struct rloc *y );
|
||||
void rlocs_set_path_mtu( struct rlocs *reg, struct rloc *x, struct rloc *y, unsigned short new_mtu );
|
||||
|
||||
void rlocs_free( struct rlocs *registry );
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user