(Boeing r91)
globally replace SMA_CRAWLER with a more general HIP_VPLS tag git-svn-id: svn://svn.code.sf.net/p/openhip/code/hip/trunk@118 4c5cb64f-9889-4596-9799-84b02dc3effa
This commit is contained in:
parent
f57b67fde0
commit
03ead9b296
|
@ -1,11 +1,11 @@
|
|||
#!/bin/sh
|
||||
|
||||
# libtool is only used to build the configuration libraries associated
|
||||
# with the --enable-sma-crawler configure option
|
||||
if [ "$1a" = "--enable-sma-crawlera" ]; then
|
||||
# with the --enable-vpls configure option
|
||||
if [ "$1a" = "--enable-vplsa" ]; then
|
||||
LIBTOOLIZE_MSG="echo '(1.5/3) Running libtoolize...'"
|
||||
LIBTOOLIZE="libtoolize --force --copy --automake"
|
||||
CONFOPTS=" --enable-sma-crawler"
|
||||
CONFOPTS=" --enable-vpls"
|
||||
if [ -e src/util/Makefile.am.disabled ]; then
|
||||
mv src/util/Makefile.am.disabled src/util/Makefile.am
|
||||
fi
|
||||
|
@ -23,7 +23,7 @@ elif [ "$1a" = "a" ]; then
|
|||
mv configure.ac.orig configure.ac
|
||||
fi
|
||||
else
|
||||
echo "usage: ./bootstrap.sh [--enable-sma-crawler]"
|
||||
echo "usage: ./bootstrap.sh [--enable-vpls]"
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
|
|
70
configure.ac
70
configure.ac
|
@ -63,8 +63,6 @@ if test "x$ac_cv_lib_crypto_RSA_verify" != "xyes"; then
|
|||
AC_MSG_ERROR([Could not find RSA functions from OpenSSL. Make sure the openssl-devel package is installed or that you have installed the suitable source.])
|
||||
fi
|
||||
|
||||
#
|
||||
# configure option to define SMA_CRAWLER
|
||||
AC_CHECK_LIB([pthread], [pthread_create])
|
||||
# FIXME: Replace `main' with a function in `-li3', `-li3client':
|
||||
#AC_CHECK_LIB([i3], [main])
|
||||
|
@ -110,12 +108,12 @@ AC_ARG_ENABLE(kernel-support,
|
|||
[enable_kernel=default
|
||||
AC_MSG_RESULT(no)])
|
||||
|
||||
AC_MSG_CHECKING(if --enable-sma-crawler option is specified)
|
||||
AC_ARG_ENABLE(sma-crawler,
|
||||
[ --enable-sma-crawler=config enable SMA crawler with configuration via {files, LDAP, IFMAP}],
|
||||
[enable_sma_crawler=$enable_sma_crawler
|
||||
AC_MSG_CHECKING(if --enable-vpls option is specified)
|
||||
AC_ARG_ENABLE(vpls,
|
||||
[ --enable-vpls=config enable VPLS with configuration via {files, LDAP, IFMAP}],
|
||||
[enable_vpls=$enable_vpls
|
||||
AC_MSG_RESULT(yes)],
|
||||
[enable_sma_crawler=default
|
||||
[enable_vpls=default
|
||||
AC_MSG_RESULT(no)])
|
||||
|
||||
AC_MSG_CHECKING(if --enable-mobile-router option is specified)
|
||||
|
@ -207,42 +205,42 @@ if test "$kernel_support" = "yes"; then
|
|||
fi
|
||||
|
||||
#
|
||||
# configure option to define SMA_CRAWLER
|
||||
# configure option to define HIP_VPLS
|
||||
################################################################################
|
||||
if test "$enable_sma_crawler" = "yes"; then
|
||||
enable_sma_crawler="files" ;# default value
|
||||
if test "$enable_vpls" = "yes"; then
|
||||
enable_vpls="files" ;# default value
|
||||
fi
|
||||
if test "$enable_sma_crawler" = "files" -o "$enable_sma_crawler" = "LDAP" -o "$enable_sma_crawler" = "IFMAP"; then
|
||||
want_sma_crawler=true
|
||||
want_sma_crawler_files_cfg=false
|
||||
want_sma_crawler_LDAP_cfg=false
|
||||
want_sma_crawler_IFMAP_cfg=false
|
||||
CFLAGS=" -DSMA_CRAWLER $CFLAGS"
|
||||
if test "$enable_vpls" = "files" -o "$enable_vpls" = "LDAP" -o "$enable_vpls" = "IFMAP"; then
|
||||
want_vpls=true
|
||||
want_vpls_files_cfg=false
|
||||
want_vpls_LDAP_cfg=false
|
||||
want_vpls_IFMAP_cfg=false
|
||||
CFLAGS=" -DHIP_VPLS $CFLAGS"
|
||||
|
||||
AC_CHECK_LIB([ssl], [SSL_library_init])
|
||||
if test "x$ac_cv_lib_ssl_SSL_library_init" = "xyes"; then
|
||||
AC_MSG_RESULT(
|
||||
[OpenSSL library found for SMA crawler extensions])
|
||||
[OpenSSL library found for VPLS extensions])
|
||||
else
|
||||
AC_MSG_ERROR(
|
||||
[SMA crawler extensions requested but OpenSSL library not found.])
|
||||
[VPLS extensions requested but OpenSSL library not found.])
|
||||
fi
|
||||
|
||||
if test "$enable_sma_crawler" = "files"; then
|
||||
if test "$enable_vpls" = "files"; then
|
||||
AC_MSG_RESULT([Will use file-based configuration library libhipcfgfiles.so])
|
||||
want_sma_crawler_files_cfg=true
|
||||
elif test "$enable_sma_crawler" = "LDAP"; then
|
||||
want_vpls_files_cfg=true
|
||||
elif test "$enable_vpls" = "LDAP"; then
|
||||
AC_CHECK_LIB([ldap],ldap_add_ext,,AC_MSG_ERROR([LDAP-based configuration library requested but OpenLDAP development libraries not found. Aborting.]))
|
||||
AC_CHECK_LIB([ldapcpp],main,,AC_MSG_ERROR([LDAP-based configuration library requested but LDAP C++ library not found. Aborting]))
|
||||
AC_MSG_RESULT([Will use LDAP-based configuration library libhipcfgldap.so])
|
||||
want_sma_crawler_LDAP_cfg=true
|
||||
elif test "$enable_sma_crawler" = "IFMAP"; then
|
||||
want_vpls_LDAP_cfg=true
|
||||
elif test "$enable_vpls" = "IFMAP"; then
|
||||
AC_MSG_RESULT([Will use IFMAP-based configuration library libhipcfgmap.so])
|
||||
want_sma_crawler_IFMAP_cfg=true
|
||||
want_vpls_IFMAP_cfg=true
|
||||
fi
|
||||
|
||||
else
|
||||
want_sma_crawler=false
|
||||
want_vpls=false
|
||||
fi
|
||||
|
||||
#
|
||||
|
@ -276,13 +274,13 @@ esac
|
|||
AM_CONDITIONAL(WANT_KERNEL, test x$want_kernel = xtrue)
|
||||
AM_CONDITIONAL(WANT_MOBILE_ROUTER, test x$want_mobile_router = xtrue)
|
||||
AM_CONDITIONAL(WANT_OSX, test x$want_osx = xtrue)
|
||||
AM_CONDITIONAL(WANT_SMA_CRAWLER, test x$want_sma_crawler = xtrue)
|
||||
AM_CONDITIONAL(WANT_SMA_CRAWLER_FILES_CFG,
|
||||
test x$want_sma_crawler_files_cfg = xtrue)
|
||||
AM_CONDITIONAL(WANT_SMA_CRAWLER_LDAP_CFG,
|
||||
test x$want_sma_crawler_LDAP_cfg = xtrue)
|
||||
AM_CONDITIONAL(WANT_SMA_CRAWLER_IFMAP_CFG,
|
||||
test x$want_sma_crawler_IFMAP_cfg = xtrue)
|
||||
AM_CONDITIONAL(WANT_VPLS, test x$want_vpls = xtrue)
|
||||
AM_CONDITIONAL(WANT_VPLS_FILES_CFG,
|
||||
test x$want_vpls_files_cfg = xtrue)
|
||||
AM_CONDITIONAL(WANT_VPLS_LDAP_CFG,
|
||||
test x$want_vpls_LDAP_cfg = xtrue)
|
||||
AM_CONDITIONAL(WANT_VPLS_IFMAP_CFG,
|
||||
test x$want_vpls_IFMAP_cfg = xtrue)
|
||||
|
||||
#AC_SUBST(WANT_KERNEL, $want_kernel)
|
||||
|
||||
|
@ -317,11 +315,11 @@ else
|
|||
fi
|
||||
AC_MSG_NOTICE([ ])
|
||||
|
||||
if test $want_sma_crawler = true; then
|
||||
AC_MSG_NOTICE([ - building HIP SMA crawler extensions])
|
||||
AC_MSG_NOTICE([ - will use $enable_sma_crawler-based configuration library])
|
||||
if test $want_vpls = true; then
|
||||
AC_MSG_NOTICE([ - building virtual private LAN service extensions])
|
||||
AC_MSG_NOTICE([ - will use $enable_vpls-based configuration library])
|
||||
else
|
||||
AC_MSG_NOTICE([ - NOT building HIP SMA crawler extensions])
|
||||
AC_MSG_NOTICE([ - NOT building virtual private LAN service extensions])
|
||||
fi
|
||||
AC_MSG_NOTICE([ ])
|
||||
|
||||
|
|
|
@ -65,8 +65,8 @@ endif
|
|||
INCLUDES = -I./include @libxml2_CFLAGS@
|
||||
LDADD = @libxml2_LIBS@ -lz -ldl
|
||||
|
||||
# SMA craweler support
|
||||
if WANT_SMA_CRAWLER
|
||||
# VPLS support
|
||||
if WANT_VPLS
|
||||
SRC_USERMODE += usermode/hip_endbox.c
|
||||
SRC_UTIL += util/cfg-api/hip_cfg_api.c
|
||||
SRC_HITGEN += util/sc_utils.c
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#ifndef __SMA_ENDBOX_UTILS__
|
||||
#define __SMA_ENDBOX_UTILS__
|
||||
#ifndef _ENDBOX_UTILS_H_
|
||||
#define _ENDBOX_UTILS_H_
|
||||
|
||||
#include <asm/types.h>
|
||||
#include <ctype.h>
|
||||
|
@ -62,4 +62,4 @@ void endbox_periodic_heartbeat(time_t *now_time, time_t *last_time,
|
|||
void endbox_ipv4_multicast_write(__u8 *data, int offset, int len);
|
||||
void endbox_esp_decrypt(__u8 *out, int *offset);
|
||||
|
||||
#endif
|
||||
#endif /* _ENDBOX_UTILS_H_ */
|
||||
|
|
|
@ -267,9 +267,9 @@ void hex_print(register const char *indent, register const u_char *cp, register
|
|||
/* hip_xml.c */
|
||||
int locate_config_file(char *filename, int filename_size, char *default_name);
|
||||
int read_identities_file(char *filename, int mine);
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
int read_peer_identities_from_hipcfg();
|
||||
#endif /* SMA_CRAWLER */
|
||||
#endif /* HIP_VPLS */
|
||||
void print_hi_to_buff(uint8_t **bufp, int *buf_len, hi_node *hi, int mine);
|
||||
int save_identities_file(int);
|
||||
int read_conf_file(char *);
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
|
||||
#include <hip/hip_proto.h>
|
||||
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
#define NIPQUAD(addr) \
|
||||
((unsigned char *)&addr)[0], \
|
||||
((unsigned char *)&addr)[1], \
|
||||
|
@ -86,9 +86,9 @@
|
|||
|
||||
#define MAX_REGISTRATIONS 1024
|
||||
#define MAX_REGISTRATION_TYPES 8 /* number of registration services */
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
#define MAX_LEGACY_HOSTS 255 /* how many legacy hosts can attached to endbox */
|
||||
#endif /* SMA_CRAWLER */
|
||||
#endif /* HIP_VPLS */
|
||||
#ifdef MOBILE_ROUTER
|
||||
#define MAX_MR_CLIENTS MAX_CONNECTIONS /* Number of mobile router clients */
|
||||
#endif /* MOBILE_ROUTER */
|
||||
|
@ -450,7 +450,7 @@ typedef struct _hi_node {
|
|||
int name_len; /* use this instead of strlen() */
|
||||
} hi_node;
|
||||
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
struct peer_node
|
||||
{
|
||||
hip_hit hit;
|
||||
|
@ -463,7 +463,7 @@ struct peer_node
|
|||
char name[MAX_HI_NAMESIZE];
|
||||
struct _sockaddr_list **rvs_addrs;
|
||||
};
|
||||
#endif /* SMA_CRAWLER */
|
||||
#endif /* HIP_VPLS */
|
||||
|
||||
/* DH Cache
|
||||
*/
|
||||
|
@ -856,7 +856,7 @@ struct hip_conf {
|
|||
__u8 max_reg_lifetime; /* offered max registration lifetime */
|
||||
__u8 peer_certificate_required;
|
||||
__u8 use_smartcard; /* use smartcard for hostid, RSA/DSA sign and X.509 certificate */
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
char *smartcard_pin; /* the pin */
|
||||
char *smartcard_key_id; /* the smartcard key to use */
|
||||
char *smartcard_openssl_engine; /* the smartcard openssl engine interface */
|
||||
|
@ -868,7 +868,7 @@ struct hip_conf {
|
|||
char *cfg_serv_basedn; /* e.g. ldap base dn */
|
||||
char *cfg_serv_login_id; /* e.g. ldap binddn */
|
||||
char *cfg_serv_login_pwd; /* e.g. ldap bindpw */
|
||||
#endif /* SMA_CRAWLER */
|
||||
#endif /* HIP_VPLS */
|
||||
char conf_filename[255];
|
||||
char my_hi_filename[255];
|
||||
char known_hi_filename[255];
|
||||
|
|
|
@ -70,7 +70,7 @@ int pfkey_send_hip_packet(char *data, int len);
|
|||
#define CONFIG_HIP
|
||||
#endif
|
||||
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
#define HIP_TAP_INTERFACE_MTU 1500
|
||||
#else
|
||||
#define HIP_TAP_INTERFACE_MTU 1400
|
||||
|
|
|
@ -79,7 +79,7 @@
|
|||
#include <hip/hip_globals.h>
|
||||
#include <hip/hip_funcs.h>
|
||||
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
#include <hip/hip_cfg_api.h>
|
||||
/* From /usr/include/net/if.h - added just this line because of conflicts
|
||||
* with /usr/include/linux/if.h
|
||||
|
@ -332,7 +332,7 @@ int select_preferred_address()
|
|||
int preferred_selected, preferred_iface_index;
|
||||
sockaddr_list *l;
|
||||
__u32 ip;
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
int ifindex1, ifindex2;
|
||||
#endif
|
||||
#ifndef USE_LINUX_NETLINK
|
||||
|
@ -438,10 +438,10 @@ int select_preferred_address()
|
|||
#else /* USE_LINUX_NETLINK */
|
||||
/* Linux version */
|
||||
/* XXX TODO: dump routing table and choose addr w/default route. */
|
||||
#ifdef SMA_CRAWLER
|
||||
log_(NORM,"crawler primary master interface = %s\n",
|
||||
#ifdef HIP_VPLS
|
||||
log_(NORM,"VPLS primary master interface = %s\n",
|
||||
HCNF.master_interface);
|
||||
log_(NORM,"crawler secondary master interface = %s\n",
|
||||
log_(NORM,"VPLS secondary master interface = %s\n",
|
||||
HCNF.master_interface2);
|
||||
ifindex1 = ifindex2 = -1;
|
||||
if (HCNF.master_interface)
|
||||
|
@ -459,7 +459,7 @@ int select_preferred_address()
|
|||
/* first check for preferred from conf file */
|
||||
if ((HCNF.preferred.ss_family) || (preferred_iface_index != -1)) {
|
||||
for (l = my_addr_head; l; l=l->next) {
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
/* Not on primary master interface */
|
||||
if (l->if_index != ifindex1)
|
||||
continue;
|
||||
|
@ -501,7 +501,7 @@ int select_preferred_address()
|
|||
continue;
|
||||
if (IN_LOOP(&l->addr))
|
||||
continue;
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
/* Not on primary master interface */
|
||||
if (l->if_index != ifindex1)
|
||||
continue;
|
||||
|
@ -517,7 +517,7 @@ int select_preferred_address()
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
/* Did not find an address on the primary master interface */
|
||||
if (!preferred_selected && !l) {
|
||||
for (l = my_addr_head; l; l=l->next) {
|
||||
|
@ -1300,7 +1300,7 @@ void association_add_address(hip_assoc *hip_a, struct sockaddr *newaddr,
|
|||
{
|
||||
sockaddr_list *list, *l;
|
||||
struct sockaddr *oldaddr;
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
int ifindex1, ifindex2;
|
||||
#endif
|
||||
|
||||
|
@ -1334,7 +1334,7 @@ void association_add_address(hip_assoc *hip_a, struct sockaddr *newaddr,
|
|||
/* TODO: IPv6 UDP support here */
|
||||
}
|
||||
list = &hip_a->hi->addrs;
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
/* If the new address is on master_interface and it is not
|
||||
* the current interface, switch to the new address */
|
||||
ifindex1 = ifindex2 = -1;
|
||||
|
@ -1349,7 +1349,7 @@ void association_add_address(hip_assoc *hip_a, struct sockaddr *newaddr,
|
|||
/* this function checks if the address already exists */
|
||||
l = add_address_to_list(&list, newaddr, if_index);
|
||||
make_address_active(l);
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -67,9 +67,9 @@
|
|||
#include <hip/hip_proto.h>
|
||||
#include <hip/hip_globals.h>
|
||||
#include <hip/hip_funcs.h>
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
#include <hip/hip_cfg_api.h>
|
||||
#endif /* SMA_CRAWLER */
|
||||
#endif /* HIP_VPLS */
|
||||
|
||||
/*
|
||||
* Local function declarations
|
||||
|
@ -375,7 +375,7 @@ int hip_handle_I1(__u8 *buff, hip_assoc* hip_a, struct sockaddr *src,
|
|||
|
||||
/* Find peer HIT */
|
||||
peer_host_id = find_host_identity(peer_hi_head, hiti);
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
if (!peer_host_id && hipcfg_allowed_peers(hiti, hitr)) {
|
||||
log_(NORMT,"Accepted an allowed peer "
|
||||
"Endbox HIT in I1\n");
|
||||
|
@ -398,7 +398,7 @@ int hip_handle_I1(__u8 *buff, hip_assoc* hip_a, struct sockaddr *src,
|
|||
add_peer_hit(hiti, src);
|
||||
}
|
||||
}
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
if(!hipcfg_allowed_peers(hiti, hitr)){
|
||||
log_(NORMT,"ACL denied for HIP peer\n");
|
||||
return -1;
|
||||
|
@ -3354,7 +3354,7 @@ decode_dh:
|
|||
pub_key = malloc(len);
|
||||
memcpy(pub_key, tlv_dh->pub, len);
|
||||
|
||||
#ifndef SMA_CRAWLER
|
||||
#ifndef HIP_VPLS
|
||||
log_(NORM, "Got DH public value of len %d: 0x", len);
|
||||
print_hex(pub_key, len);
|
||||
log_(NORM, "\n");
|
||||
|
@ -3396,7 +3396,7 @@ int handle_cert(hip_assoc *hip_a, const __u8 *data)
|
|||
cert = (tlv_cert*) data;
|
||||
len = ntohs(cert->length)-4;
|
||||
memcpy(cert_buf, cert->certificate, len);
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
len = hipcfg_verifyCert(cert_buf, peer_hi->hit);
|
||||
if(len == 1) {
|
||||
log_(NORM, "validated certificate with url: %s\n", cert_buf);
|
||||
|
|
|
@ -69,9 +69,9 @@
|
|||
#include <hip/hip_proto.h>
|
||||
#include <hip/hip_globals.h>
|
||||
#include <hip/hip_funcs.h>
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
#include <hip/hip_cfg_api.h>
|
||||
#endif /* SMA_CRAWLER */
|
||||
#endif /* HIP_VPLS */
|
||||
|
||||
#define IPSEC_PFKEYv2_ALIGN (sizeof(uint64_t) / sizeof(uint8_t))
|
||||
#define PFKEY_ALIGN8(a) (1 + (((a) - 1) | (8 - 1)))
|
||||
|
@ -1560,7 +1560,7 @@ int hip_convert_lsi_to_peer(struct sockaddr *lsi, hip_hit *hitp,
|
|||
hi_node *peer_hi = NULL;
|
||||
int want_family = 0, dns_ok = TRUE;
|
||||
struct sockaddr addr;
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
sockaddr_list *list;
|
||||
struct sockaddr *old_addr;
|
||||
#endif
|
||||
|
@ -1578,7 +1578,7 @@ int hip_convert_lsi_to_peer(struct sockaddr *lsi, hip_hit *hitp,
|
|||
* those cached from HIP DNS lookups)
|
||||
*/
|
||||
peer_hi = lsi_lookup(lsi);
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
if (!peer_hi) {
|
||||
log_(NORM, "peer HI not found, "
|
||||
"reloading from hipcfg\n");
|
||||
|
@ -1599,7 +1599,7 @@ int hip_convert_lsi_to_peer(struct sockaddr *lsi, hip_hit *hitp,
|
|||
log_(NORM, "Peer IP is unchanged\n");
|
||||
}
|
||||
}
|
||||
#endif /* SMA_CRAWLER */
|
||||
#endif /* HIP_VPLS */
|
||||
if (!peer_hi || hits_equal(peer_hi->hit, zero_hit)) {
|
||||
/* Peer doesn't exist locally or has an empty HIT.
|
||||
* TODO: perform DHT lookup to retrieve HIT and adopt
|
||||
|
|
|
@ -61,7 +61,7 @@ int set_secret_key(unsigned char *key, hip_assoc *hip_a)
|
|||
free(hip_a->dh_secret);
|
||||
hip_a->dh_secret = key;
|
||||
|
||||
#ifndef SMA_CRAWLER
|
||||
#ifndef HIP_VPLS
|
||||
log_(NORM, "************\nDH secret key set to:\n0x");
|
||||
print_hex(hip_a->dh_secret, keylen);
|
||||
log_(NORM, "\n***********\n");
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
#include <time.h> /* time() */
|
||||
#include <ctype.h> /* tolower() */
|
||||
#include <fcntl.h>
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
#include <utime.h>
|
||||
#include <sys/resource.h> /* getrlimit, setrlimit */
|
||||
#endif
|
||||
|
@ -81,7 +81,7 @@
|
|||
#include <hip/hip_proto.h>
|
||||
#include <hip/hip_globals.h>
|
||||
#include <hip/hip_funcs.h>
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
#include <hip/hip_cfg_api.h>
|
||||
#endif
|
||||
|
||||
|
@ -124,7 +124,7 @@ int hip_trigger_rvs(struct sockaddr*rvs, hip_hit *responder);
|
|||
void post_init_tap();
|
||||
#endif
|
||||
#endif
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
void endbox_init();
|
||||
int hipcfg_init();
|
||||
extern __u32 get_preferred_lsi(struct sockaddr *);
|
||||
|
@ -167,7 +167,7 @@ int main_loop(int argc, char **argv)
|
|||
int highest_descriptor=0;
|
||||
int flags=0, err=0, length=0, last_expire=0, i;
|
||||
int need_select_preferred=FALSE;
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
time_t last_time, now_time;
|
||||
int ret;
|
||||
struct rlimit limits;
|
||||
|
@ -410,7 +410,7 @@ int main_loop(int argc, char **argv)
|
|||
* Load the my_host_identities.xml file.
|
||||
*/
|
||||
my_hi_head = NULL;
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
hi_node *my_hi;
|
||||
if (!HCNF.cfg_library) {
|
||||
log_(ERR, "Must specify <cfg_library> in hip.conf\n");
|
||||
|
@ -430,7 +430,7 @@ int main_loop(int argc, char **argv)
|
|||
/* use smartcard for signing */
|
||||
append_hi_node(&my_hi_head, my_hi);
|
||||
} else {
|
||||
#endif /* SMA_CRAWLER */
|
||||
#endif /* HIP_VPLS */
|
||||
if ((locate_config_file(HCNF.my_hi_filename,
|
||||
sizeof(HCNF.my_hi_filename), HIP_MYID_FILENAME) < 0)) {
|
||||
log_(ERR, "Unable to locate this machine's %s file.\n",
|
||||
|
@ -467,9 +467,9 @@ int main_loop(int argc, char **argv)
|
|||
log_(ERR, "Because there are no peer identities, you probab"
|
||||
"ly need to run with the -a\n (allow any) option.\n");
|
||||
}
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
}
|
||||
#endif /* SMA_CRAWLER */
|
||||
#endif /* HIP_VPLS */
|
||||
|
||||
if (get_preferred_hi(my_hi_head)==NULL) {
|
||||
log_(ERR, "The preferred HI specified in %s was not found.\n",
|
||||
|
@ -477,9 +477,9 @@ int main_loop(int argc, char **argv)
|
|||
goto hip_main_error_exit;
|
||||
}
|
||||
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
endbox_init();
|
||||
log_(NORM,"Initializing SMA bridge\n");
|
||||
log_(NORM,"Initializing VPLS bridge\n");
|
||||
struct sockaddr_storage ss_lsi;
|
||||
struct sockaddr *lsi = (struct sockaddr*)&ss_lsi;
|
||||
lsi->sa_family = AF_INET;
|
||||
|
@ -664,7 +664,7 @@ int main_loop(int argc, char **argv)
|
|||
iov.iov_len = sizeof(buff);
|
||||
iov.iov_base = buff;
|
||||
#endif /* __WIN32__ */
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
now_time = time(NULL);
|
||||
if (now_time - last_time > 60) {
|
||||
log_(NORMT, "hipd_main() heartbeat\n");
|
||||
|
|
|
@ -72,9 +72,9 @@
|
|||
#include "i3_hip.h"
|
||||
#endif
|
||||
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
#include <hip/hip_cfg_api.h>
|
||||
#endif /* SMA_CRAWLER */
|
||||
#endif /* HIP_VPLS */
|
||||
|
||||
/*
|
||||
* Forward declaration of local functions.
|
||||
|
@ -1798,7 +1798,7 @@ int build_tlv_dh(__u8 *data, __u8 group_id, DH *dh, int debug)
|
|||
d->pub_len = ntohs((__u16)len);
|
||||
d->length = htons((__u16)(3 + len)); /* group_id + pub */
|
||||
|
||||
#ifndef SMA_CRAWLER
|
||||
#ifndef HIP_VPLS
|
||||
if (D_VERBOSE == debug) {
|
||||
log_(NORM, "Using DH public value of len %d: 0x", len);
|
||||
print_hex(bin, len);
|
||||
|
@ -1971,7 +1971,7 @@ int build_tlv_echo_response(__u16 type, __u16 length, __u8 *buff, __u8 *data)
|
|||
|
||||
int build_tlv_cert(__u8 *buff)
|
||||
{
|
||||
#ifndef SMA_CRAWLER
|
||||
#ifndef HIP_VPLS
|
||||
return 0;
|
||||
#else
|
||||
tlv_cert *cert;
|
||||
|
@ -1997,7 +1997,7 @@ int build_tlv_cert(__u8 *buff)
|
|||
memcpy(cert->certificate, data, cert_len); //certificate URL
|
||||
|
||||
return(eight_byte_align(4 + 4 + cert_len ));
|
||||
#endif /* SMA_CRAWLER */
|
||||
#endif /* HIP_VPLS */
|
||||
}
|
||||
|
||||
int build_tlv_signature(hi_node *hi, __u8 *data, int location, int R1)
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
#include <sys/time.h> /* gettimeofday() */
|
||||
#include <arpa/nameser.h> /* NS_PACKETSZ */
|
||||
#endif
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
#include <utime.h>
|
||||
#endif
|
||||
#include <stdio.h> /* printf() */
|
||||
|
@ -160,7 +160,7 @@ void *hip_dns(void *arg)
|
|||
#endif
|
||||
|
||||
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
time_t last_time, now_time;
|
||||
last_time = time(NULL);
|
||||
printf("hip_dns() thread (tid %d pid %d) started...\n",
|
||||
|
@ -193,7 +193,7 @@ void *hip_dns(void *arg)
|
|||
timeout.tv_sec = 0;
|
||||
timeout.tv_usec = 500000;
|
||||
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
now_time = time(NULL);
|
||||
if (now_time - last_time > 60) {
|
||||
printf("hip_dns() heartbeat\n");
|
||||
|
|
|
@ -12,13 +12,13 @@
|
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* hip_sma.c
|
||||
* hip_endbox.c
|
||||
*
|
||||
* Authors: Jeff Ahrenholz <jeffrey.m.ahrenholz@boeing.com>
|
||||
* Orlie Brewer <orlie.t.brewer@boeing.com>
|
||||
* Jeff Meegan, <jeff.r.meegan@boeing.com>
|
||||
*
|
||||
* Secure Mobile Architecture (SMA) crawler specific functions.
|
||||
* HIP Virtual Private LAN Service (VPLS) specific functions.
|
||||
*
|
||||
*/
|
||||
#include <stdio.h> /* printf() */
|
||||
|
@ -51,12 +51,12 @@
|
|||
#include <win32/checksum.h>
|
||||
#endif
|
||||
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
#include <utime.h>
|
||||
#include <netinet/ether.h>
|
||||
#include <hip/hip_cfg_api.h>
|
||||
#include <hip/endbox_utils.h>
|
||||
#endif /* SMA_CRAWLER */
|
||||
#endif /* HIP_VPLS */
|
||||
|
||||
#define BUFF_LEN 2000
|
||||
|
||||
|
|
|
@ -63,18 +63,18 @@
|
|||
#include <win32/checksum.h>
|
||||
#endif
|
||||
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
#include <utime.h>
|
||||
#include <netinet/ether.h>
|
||||
#include <hip/hip_cfg_api.h>
|
||||
#include <hip/endbox_utils.h>
|
||||
#endif /* SMA_CRAWLER */
|
||||
#endif /* HIP_VPLS */
|
||||
|
||||
/*
|
||||
* Globals
|
||||
*/
|
||||
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
int touchHeartbeat;
|
||||
#endif
|
||||
|
||||
|
@ -185,7 +185,7 @@ void *hip_esp_output(void *arg)
|
|||
static hip_sadb_entry *entry;
|
||||
struct sockaddr_storage ss_lsi;
|
||||
struct sockaddr *lsi = (struct sockaddr*)&ss_lsi;
|
||||
#ifndef SMA_CRAWLER
|
||||
#ifndef HIP_VPLS
|
||||
__u32 lsi_ip;
|
||||
#else
|
||||
time_t last_time, now_time;
|
||||
|
@ -212,7 +212,7 @@ void *hip_esp_output(void *arg)
|
|||
get_preferred_lsi(lsi);
|
||||
g_tap_lsi = LSI4(lsi);
|
||||
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
touchHeartbeat=1;
|
||||
last_time = time(NULL);
|
||||
printf("hip_esp_output() thread (tid %d pid %d) started...\n",
|
||||
|
@ -233,7 +233,7 @@ void *hip_esp_output(void *arg)
|
|||
timeout.tv_sec = 0;
|
||||
timeout.tv_usec = g_read_usec;
|
||||
#endif
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
endbox_periodic_heartbeat(&now_time, &last_time, &packet_count,
|
||||
"output", touchHeartbeat);
|
||||
#endif
|
||||
|
@ -269,7 +269,7 @@ void *hip_esp_output(void *arg)
|
|||
if ((raw_buff[12] == 0x08) && (raw_buff[13] == 0x00)) {
|
||||
iph = (struct ip*) &raw_buff[14];
|
||||
/* accept IPv4 traffic to 1.x.x.x here */
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
if (endbox_ipv4_packet_check(iph, lsi, &packet_count)<0)
|
||||
continue;
|
||||
is_broadcast = FALSE;
|
||||
|
@ -277,7 +277,7 @@ void *hip_esp_output(void *arg)
|
|||
(((ntohl(iph->ip_dst.s_addr)) & 0x000000FF) ==
|
||||
0x000000FF)) {
|
||||
|
||||
#else /* SMA_CRAWLER */
|
||||
#else /* HIP_VPLS */
|
||||
|
||||
if (((iph->ip_v) == IPVERSION) &&
|
||||
#if defined(__BIG_ENDIAN__) || defined(__arm__)
|
||||
|
@ -294,7 +294,7 @@ void *hip_esp_output(void *arg)
|
|||
if ((lsi_ip & 0x00FFFFFF)==0x00FFFFFF) {
|
||||
if (!do_bcast())
|
||||
continue;
|
||||
#endif /* SMA_CRAWLER */
|
||||
#endif /* HIP_VPLS */
|
||||
/* unicast the broadcast to each entry */
|
||||
entry = hip_sadb_get_next(NULL);
|
||||
is_broadcast = TRUE;
|
||||
|
@ -535,7 +535,7 @@ void *hip_esp_input(void *arg)
|
|||
DWORD lenin;
|
||||
OVERLAPPED overlapped = {0};
|
||||
#endif
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
time_t last_time, now_time;
|
||||
int packet_count = 0;
|
||||
|
||||
|
@ -580,7 +580,7 @@ void *hip_esp_input(void *arg)
|
|||
memset(data, 0, sizeof(data));
|
||||
|
||||
/* periodic functions called every g_read_usec timeout */
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
endbox_periodic_heartbeat(&now_time, &last_time, &packet_count,
|
||||
"input", touchHeartbeat);
|
||||
#endif
|
||||
|
@ -622,15 +622,15 @@ void *hip_esp_input(void *arg)
|
|||
continue;
|
||||
}
|
||||
#else /* __WIN32__ */
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
packet_count++;
|
||||
iph = (struct ip*) &data[offset + sizeof(struct eth_hdr)];
|
||||
endbox_ipv4_multicast_write(data, offset, len);
|
||||
#else /* SMA_CRAWLER */
|
||||
#else /* HIP_VPLS */
|
||||
if (write(tapfd, &data[offset], len) < 0) {
|
||||
printf("hip_esp_input() write() failed.\n");
|
||||
}
|
||||
#endif /* SMA_CRAWLER */
|
||||
#endif /* HIP_VPLS */
|
||||
#endif /* __WIN32__ */
|
||||
} else if (FD_ISSET(s_esp_udp, &fd)) {
|
||||
#ifdef __WIN32__
|
||||
|
@ -791,7 +791,7 @@ void *tunreader(void *arg)
|
|||
struct timeval timeout;
|
||||
fd_set read_fdset;
|
||||
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
time_t last_time, now_time;
|
||||
|
||||
last_time = time(NULL);
|
||||
|
@ -807,7 +807,7 @@ void *tunreader(void *arg)
|
|||
FD_SET((unsigned)tapfd, &read_fdset);
|
||||
timeout.tv_sec = 3;
|
||||
timeout.tv_usec = 0;
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
now_time = time(NULL);
|
||||
if (now_time - last_time > 60) {
|
||||
printf("tunreader() heartbeat\n");
|
||||
|
@ -990,7 +990,7 @@ int handle_arp(__u8 *in, int len, __u8 *out, int *outlen, struct sockaddr *addr)
|
|||
arp_req = (struct arp_req_data*)(arp_req_hdr + 1);
|
||||
ip_sender = arp_req->src_ip;
|
||||
ip_dst = arp_req->dst_ip;
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
// log_(NORM, "##################### Raw src ip: %0X\n", ip_sender);
|
||||
// log_(NORM, "##################### Raw dst ip: %0X\n", ip_dst);
|
||||
/* do not proxy legacy node if both are behind the bridge */
|
||||
|
@ -1005,13 +1005,13 @@ int handle_arp(__u8 *in, int len, __u8 *out, int *outlen, struct sockaddr *addr)
|
|||
return(1);
|
||||
|
||||
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
struct sockaddr_storage legacy_host_ss, eb_ss;
|
||||
struct sockaddr *legacy_host_p = (struct sockaddr*)&legacy_host_ss;
|
||||
struct sockaddr *eb_p = (struct sockaddr*)&eb_ss;
|
||||
legacy_host_p->sa_family = AF_INET;
|
||||
LSI4(legacy_host_p) = ip_dst;
|
||||
// log_(NORM, "SMA_CRAWLER dst ip: %0X\n", ip_dst);
|
||||
// log_(NORM, "HIP_VPLS dst ip: %0X\n", ip_dst);
|
||||
eb_p->sa_family = AF_INET;
|
||||
if(!hipcfg_getEndboxByLegacyNode(legacy_host_p, eb_p)){
|
||||
if (IS_LSI32(ip_dst)) {
|
||||
|
@ -1096,7 +1096,7 @@ int hip_esp_encrypt(__u8 *in, int len, __u8 *out, int *outlen,
|
|||
struct ip_esp_padinfo *padinfo=0;
|
||||
__u8 cbc_iv[16];
|
||||
__u8 hmac_md[EVP_MAX_MD_SIZE];
|
||||
#ifndef SMA_CRAWLER
|
||||
#ifndef HIP_VPLS
|
||||
__u16 checksum_fix = 0;
|
||||
#endif
|
||||
int family, use_udp = FALSE;
|
||||
|
@ -1110,31 +1110,31 @@ int hip_esp_encrypt(__u8 *in, int len, __u8 *out, int *outlen,
|
|||
switch (family) {
|
||||
case AF_INET:
|
||||
iph = (struct ip*) &in[sizeof(struct eth_hdr)];
|
||||
#ifndef SMA_CRAWLER
|
||||
#ifndef HIP_VPLS
|
||||
/* BEET mode uses transport mode encapsulation. IP header is
|
||||
* not included. */
|
||||
hdr_len = sizeof(struct eth_hdr) + sizeof(struct ip);
|
||||
/* rewrite upper-layer checksum, so it is based on HITs */
|
||||
checksum_fix = rewrite_checksum((__u8*)iph, entry->hit_magic);
|
||||
#else
|
||||
/* SMA_CRAWLER uses tunnel mode encapsulation. IP header is
|
||||
/* HIP_VPLS uses tunnel mode encapsulation. IP header is
|
||||
* included. */
|
||||
hdr_len = sizeof(struct eth_hdr);
|
||||
#endif /* SMA_CRAWLER */
|
||||
#endif /* HIP_VPLS */
|
||||
break;
|
||||
case AF_INET6:
|
||||
ip6h = (struct ip6_hdr*) &in[sizeof(struct eth_hdr)];
|
||||
#ifndef SMA_CRAWLER
|
||||
#ifndef HIP_VPLS
|
||||
hdr_len = sizeof(struct eth_hdr) + sizeof(struct ip6_hdr);
|
||||
#else
|
||||
hdr_len = sizeof(struct eth_hdr);
|
||||
#endif /* SMA_CRAWLER */
|
||||
#endif /* HIP_VPLS */
|
||||
/* assume HITs are used as v6 src/dst, no checksum rewrite */
|
||||
break;
|
||||
}
|
||||
|
||||
/* elen is length of data to encrypt
|
||||
* for SMA_CRAWLER, this includes the IP header.
|
||||
* for HIP_VPLS, this includes the IP header.
|
||||
*/
|
||||
elen = len - hdr_len;
|
||||
|
||||
|
@ -1199,7 +1199,7 @@ int hip_esp_encrypt(__u8 *in, int len, __u8 *out, int *outlen,
|
|||
default:
|
||||
printf("Unsupported encryption transform (%d).\n",
|
||||
entry->e_type);
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
touchHeartbeat = 0;
|
||||
#endif
|
||||
return(-1);
|
||||
|
@ -1295,7 +1295,7 @@ int hip_esp_encrypt(__u8 *in, int len, __u8 *out, int *outlen,
|
|||
break;
|
||||
}
|
||||
|
||||
#ifndef SMA_CRAWLER
|
||||
#ifndef HIP_VPLS
|
||||
/* Record the address family of this packet, so incoming
|
||||
* replies of the same protocol/ports can be matched to
|
||||
* the same family.
|
||||
|
@ -1324,7 +1324,7 @@ int hip_esp_encrypt(__u8 *in, int len, __u8 *out, int *outlen,
|
|||
((struct tcphdr*)(iph + 1))->check = checksum_fix;
|
||||
#endif
|
||||
}
|
||||
#endif /* SMA_CRAWLER */
|
||||
#endif /* HIP_VPLS */
|
||||
|
||||
/*
|
||||
* Build a UDP header at the beginning of out buffer.
|
||||
|
@ -1395,14 +1395,14 @@ int hip_esp_decrypt(__u8 *in, int len, __u8 *out, int *offset, int *outlen,
|
|||
struct ip_esp_padinfo *padinfo=0;
|
||||
__u8 cbc_iv[16];
|
||||
__u8 hmac_md[EVP_MAX_MD_SIZE];
|
||||
#ifndef SMA_CRAWLER
|
||||
#ifndef HIP_VPLS
|
||||
__u64 dst_mac;
|
||||
__u16 sum;
|
||||
int family_out;
|
||||
struct sockaddr_storage taplsi6;
|
||||
struct tcphdr *tcp=NULL;
|
||||
struct udphdr *udp=NULL;
|
||||
#endif /* SMA_CRAWLER */
|
||||
#endif /* HIP_VPLS */
|
||||
int use_udp = FALSE;
|
||||
|
||||
if (!in || !out || !entry)
|
||||
|
@ -1428,7 +1428,7 @@ int hip_esp_decrypt(__u8 *in, int len, __u8 *out, int *offset, int *outlen,
|
|||
* is decrypted into a buffer at the larger offset, since
|
||||
* we do not know the (inner) IP version before decryption. */
|
||||
*offset = sizeof(struct eth_hdr) + sizeof(struct ip6_hdr); /* 54 */
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
*offset = sizeof(struct eth_hdr); /* Tunnel mode */
|
||||
#endif
|
||||
|
||||
|
@ -1560,7 +1560,7 @@ int hip_esp_decrypt(__u8 *in, int len, __u8 *out, int *offset, int *outlen,
|
|||
padinfo = (struct ip_esp_padinfo*) &out[*offset + elen - 2];
|
||||
elen -= 2 + padinfo->pad_length;
|
||||
|
||||
#ifndef SMA_CRAWLER
|
||||
#ifndef HIP_VPLS
|
||||
/* determine address family for new packet based on
|
||||
* decrypted upper layer protocol header
|
||||
*/
|
||||
|
@ -1634,10 +1634,10 @@ int hip_esp_decrypt(__u8 *in, int len, __u8 *out, int *offset, int *outlen,
|
|||
NULL, iph, (__u16)elen, padinfo->next_hdr);
|
||||
*outlen = sizeof(struct eth_hdr) + sizeof(struct ip6_hdr)+ elen;
|
||||
}
|
||||
#else /* SMA_CRAWLER */
|
||||
#else /* HIP_VPLS */
|
||||
endbox_esp_decrypt(out, offset);
|
||||
*outlen = sizeof(struct eth_hdr) + elen;
|
||||
#endif /* SMA_CRAWLER */
|
||||
#endif /* HIP_VPLS */
|
||||
|
||||
/* previously, this happened after write(), but there
|
||||
* is some problem with using the entry ptr then */
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
#include <hip/hip_service.h>
|
||||
#include <hip/hip_sadb.h> /* access to SADB */
|
||||
#include <win32/pfkeyv2.h>
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
#include <utime.h>
|
||||
#endif
|
||||
|
||||
|
@ -88,7 +88,7 @@ void *hip_pfkey(void *arg)
|
|||
char buff[1024];
|
||||
struct sadb_msg *msg;
|
||||
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
time_t last_time, now_time;
|
||||
|
||||
last_time = time(NULL);
|
||||
|
@ -123,7 +123,7 @@ void *hip_pfkey(void *arg)
|
|||
timeout.tv_sec = 0;
|
||||
timeout.tv_usec = 1000000;
|
||||
#endif
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
now_time = time(NULL);
|
||||
if (now_time - last_time > 60) {
|
||||
printf("hip_pfkey() heartbeat\n");
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
#include <hip/hip_funcs.h> /* pthread_mutex_lock() */
|
||||
#include <win32/rtnetlink.h> /* from <linux/rtnetlink.h> */
|
||||
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
#include <utime.h>
|
||||
#endif
|
||||
|
||||
|
@ -74,7 +74,7 @@ void *hip_status(void *arg)
|
|||
struct sockaddr *from = (struct sockaddr*) &ss_from;
|
||||
struct status_tlv *req;
|
||||
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
time_t last_time, now_time;
|
||||
|
||||
last_time = time(NULL);
|
||||
|
@ -114,7 +114,7 @@ void *hip_status(void *arg)
|
|||
timeout.tv_sec = 1;
|
||||
timeout.tv_usec = 0;
|
||||
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
now_time = time(NULL);
|
||||
if (now_time - last_time > 60) {
|
||||
printf("hip_status() heartbeat\n");
|
||||
|
|
|
@ -18,27 +18,27 @@
|
|||
# Author: Jeff Ahrenholz <jeffrey.m.ahrenholz@boeing.com>
|
||||
#
|
||||
# This Makefile builds one of three possible configuration libraries,
|
||||
# controlled by the ./configure --enable-sma-crawler={files,LDAP,IFMAP} option
|
||||
# controlled by the ./configure --enable-vpls={files,LDAP,IFMAP} option
|
||||
#
|
||||
|
||||
if WANT_SMA_CRAWLER_FILES_CFG
|
||||
if WANT_VPLS_FILES_CFG
|
||||
lib_LTLIBRARIES = libhipcfgfiles.la
|
||||
SRC_HIPCFGLDAP = cfg-common/hip_cfg.cpp cfg-files/hip_cfg_files.cpp
|
||||
libhipcfgfiles_la_CPPFLAGS = -DSMA_CRAWLER -Wall -Woverloaded-virtual -Wcast-qual -DSYSCONFDIR="\"$(sysconfdir)\""
|
||||
libhipcfgfiles_la_CPPFLAGS = -DHIP_VPLS -Wall -Woverloaded-virtual -Wcast-qual -DSYSCONFDIR="\"$(sysconfdir)\""
|
||||
libhipcfgfiles_la_LDFLAGS = -version_info $(VERSION) -release $(VERSION)
|
||||
libhipcfgfiles_la_SOURCES = $(SRC_HIPCFGLDAP)
|
||||
endif
|
||||
|
||||
if WANT_SMA_CRAWLER_LDAP_CFG
|
||||
if WANT_VPLS_LDAP_CFG
|
||||
lib_LTLIBRARIES = libhipcfgldap.la
|
||||
SRC_HIPCFGLDAP = cfg-common/hip_cfg.cpp cfg-ldap/hip_cfg_ldap.cpp
|
||||
libhipcfgldap_la_CPPFLAGS = -DSMA_CRAWLER -Wall -Woverloaded-virtual -Wcast-qual -DSYSCONFDIR="\"$(sysconfdir)\""
|
||||
libhipcfgldap_la_CPPFLAGS = -DHIP_VPLS -Wall -Woverloaded-virtual -Wcast-qual -DSYSCONFDIR="\"$(sysconfdir)\""
|
||||
libhipcfgldap_la_LDFLAGS = -version_info $(VERSION) -release $(VERSION)
|
||||
libhipcfgldap_la_SOURCES = $(SRC_HIPCFGLDAP)
|
||||
endif
|
||||
|
||||
# IFMAP client library uses Qt build system
|
||||
if WANT_SMA_CRAWLER_IFMAP_CFG
|
||||
if WANT_VPLS_IFMAP_CFG
|
||||
QMAKE_PROG ?= qmake
|
||||
all-local:
|
||||
cd cfg-ifmap && $(QMAKE_PROG) -set LIBVERSION $(VERSION) && $(QMAKE_PROG) hipmapcfg.pro && make
|
||||
|
|
|
@ -6,7 +6,7 @@ CONFIG += debug \
|
|||
TARGET = hipmapcfg
|
||||
TEMPLATE = lib
|
||||
VERSION = $$[LIBVERSION]
|
||||
DEFINES += SMA_CRAWLER
|
||||
DEFINES += HIP_VPLS
|
||||
DEFINES += DEBUG
|
||||
LIBS += -lifmap \
|
||||
-lxml2 \
|
||||
|
|
|
@ -8,7 +8,7 @@ CONFIG += debug \
|
|||
TARGET = hipmapcfg
|
||||
TEMPLATE = lib
|
||||
VERSION = $$[LIBVERSION]
|
||||
DEFINES += SMA_CRAWLER
|
||||
DEFINES += HIP_VPLS
|
||||
DEFINES += DEBUG
|
||||
LIBS += -lifmap \
|
||||
-lxml2 \
|
||||
|
|
|
@ -72,7 +72,7 @@
|
|||
#endif /* __WIN32__ */
|
||||
#include <hip/hip_dns.h> /* DNS headers */
|
||||
#endif
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
#include <hip/hip_cfg_api.h>
|
||||
#endif
|
||||
|
||||
|
@ -510,7 +510,7 @@ int key_data_to_hi(const __u8 *data, __u8 alg, int hi_length, __u8 di_type,
|
|||
hi->dsa->g = BN_bin2bn(&data[offset], key_len, 0);
|
||||
offset += key_len;
|
||||
hi->dsa->pub_key = BN_bin2bn(&data[offset], key_len, 0);
|
||||
#ifndef SMA_CRAWLER
|
||||
#ifndef HIP_VPLS
|
||||
log_(NORM, "Found DSA HI with public key: 0x");
|
||||
print_hex((char *)&data[offset], key_len);
|
||||
log_(NORM, "\n");
|
||||
|
@ -523,7 +523,7 @@ int key_data_to_hi(const __u8 *data, __u8 alg, int hi_length, __u8 di_type,
|
|||
hi->rsa->e = BN_bin2bn(&data[offset], e_len, 0);
|
||||
offset += e_len;
|
||||
hi->rsa->n = BN_bin2bn(&data[offset], key_len, 0);
|
||||
#ifndef SMA_CRAWLER
|
||||
#ifndef HIP_VPLS
|
||||
log_(NORM, "Found RSA HI with public modulus: 0x");
|
||||
print_hex((char *)&data[offset], key_len);
|
||||
log_(NORM, "\n");
|
||||
|
@ -3058,7 +3058,7 @@ void hip_exit(int signal)
|
|||
close_log();
|
||||
xmlCleanupParser();
|
||||
deinit_crypto();
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
err = system("/usr/local/etc/hip/bridge_down.sh");
|
||||
//Allow config library to perform any shutdown ops
|
||||
hipcfg_close();
|
||||
|
|
|
@ -54,9 +54,9 @@
|
|||
#include <hip/hip_proto.h>
|
||||
#include <hip/hip_globals.h>
|
||||
#include <hip/hip_funcs.h>
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
#include <hip/hip_cfg_api.h>
|
||||
#endif /* SMA_CRAWLER */
|
||||
#endif /* HIP_VPLS */
|
||||
#ifdef __UMH__
|
||||
#include <hip/hip_dns.h> /* DNS headers */
|
||||
#endif
|
||||
|
@ -279,7 +279,7 @@ void parse_xml_hostid(xmlNodePtr node, hi_node *hi)
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
/*
|
||||
* function read_peer identities_from_hipcfg()
|
||||
*
|
||||
|
@ -379,7 +379,7 @@ int read_peer_identities_from_hipcfg()
|
|||
add_addresses_from_dns(NULL, NULL);
|
||||
return(0);
|
||||
}
|
||||
#endif /* SMA_CRAWLER */
|
||||
#endif /* HIP_VPLS */
|
||||
|
||||
/*
|
||||
* function read_identities_file()
|
||||
|
@ -399,10 +399,10 @@ int read_identities_file(char *filename, int mine)
|
|||
uint8_t *out_buff = NULL;
|
||||
int out_buff_len = 0;
|
||||
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
if (!mine)
|
||||
return(read_peer_identities_from_hipcfg());
|
||||
#endif /* SMA_CRAWLER */
|
||||
#endif /* HIP_VPLS */
|
||||
|
||||
doc = xmlParseFile(filename);
|
||||
if (doc == NULL) {
|
||||
|
@ -417,7 +417,7 @@ int read_identities_file(char *filename, int mine)
|
|||
hi = create_new_hi_node();
|
||||
parse_xml_attributes(node->properties, hi);
|
||||
switch (hi->algorithm_id) {
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
case HI_ALG_DSA:
|
||||
hi->dsa = hip_dsa_new();
|
||||
break;
|
||||
|
@ -431,7 +431,7 @@ int read_identities_file(char *filename, int mine)
|
|||
case HI_ALG_RSA:
|
||||
hi->rsa = RSA_new();
|
||||
break;
|
||||
#endif /* SMA_CRAWLER */
|
||||
#endif /* HIP_VPLS */
|
||||
default:
|
||||
if (mine) {
|
||||
log_(WARN, "Unknown algorithm found ");
|
||||
|
@ -667,7 +667,7 @@ int hi_to_xml(xmlNodePtr root_node, hi_node *h, int mine)
|
|||
xmlNewChild(hi, NULL, BAD_CAST "RVS", BAD_CAST addr);
|
||||
}
|
||||
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
if(!mine){
|
||||
struct sockaddr_storage hosts[MAX_LEGACY_HOSTS];
|
||||
struct sockaddr *eb_p, *host_p;
|
||||
|
@ -734,7 +734,7 @@ int save_identities_file(int mine)
|
|||
}
|
||||
hi = hi->next;
|
||||
}
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
/* XXX TODO: clean this up! */
|
||||
hip_hit hits1[MAX_HI_NAMESIZE], hits2[MAX_HI_NAMESIZE];
|
||||
int rc, i;
|
||||
|
@ -812,7 +812,7 @@ int read_conf_file(char *filename)
|
|||
} else if (strcmp((char *)node->name, "dh_group")==0) {
|
||||
sscanf(data, "%d", &tmp);
|
||||
HCNF.dh_group = (__u8)tmp;
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
} else if (strcmp((char *)node->name, "master_interface")==0) {
|
||||
HCNF.master_interface = strdup(data);
|
||||
} else if (strcmp((char *)node->name, "master_interface2")==0) {
|
||||
|
@ -970,7 +970,7 @@ int read_conf_file(char *filename)
|
|||
HCNF.peer_certificate_required = TRUE;
|
||||
else
|
||||
HCNF.peer_certificate_required = FALSE;
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
} else if (strcmp((char*)node->name,
|
||||
"use_local_known_identities")==0){
|
||||
if (strncmp(data, "yes", 3)==0)
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
#include <hip/hip_types.h>
|
||||
#include <hip/hip_funcs.h>
|
||||
#include <hip/hip_globals.h>
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
#include <openssl/ssl.h>
|
||||
#include <openssl/crypto.h> /* OpenSSL's crypto library */
|
||||
#include <openssl/bn.h> /* Big Numbers */
|
||||
|
@ -249,7 +249,7 @@ int generate_HI(xmlNodePtr root_node, hi_options *opts)
|
|||
}
|
||||
|
||||
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
int output_HI(xmlNodePtr root_node, hi_options *opts)
|
||||
{
|
||||
int err, rc;
|
||||
|
@ -693,7 +693,7 @@ int main(int argc, char *argv[])
|
|||
char rnd_seed[255];
|
||||
int i, have_filename=0, do_publish=0, do_conf=0, do_noinput=0;
|
||||
int do_append=0;
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
int do_sc_out=0;
|
||||
#endif
|
||||
hi_options opts;
|
||||
|
@ -802,7 +802,7 @@ int main(int argc, char *argv[])
|
|||
do_append = 1;
|
||||
argv++, argc--;
|
||||
continue;
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
} else if (strcmp(*argv, "-scout") == 0) {
|
||||
do_sc_out = 1;
|
||||
argv++, argc--;
|
||||
|
@ -866,7 +866,7 @@ int main(int argc, char *argv[])
|
|||
// dtd = xmlCreateIntSubset(doc,BAD_CAST "root",NULL,BAD_CAST "x.dtd");
|
||||
// xmlNewChild(parent, NsPtr ns, name, content)
|
||||
//
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
if(!do_sc_out){
|
||||
#endif
|
||||
if (do_noinput) {
|
||||
|
@ -902,7 +902,7 @@ int main(int argc, char *argv[])
|
|||
printf("Warning: could not read any input.\n");
|
||||
}
|
||||
RAND_seed(rnd_seed, sizeof rnd_seed);
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -911,7 +911,7 @@ int main(int argc, char *argv[])
|
|||
if (!opts.type)
|
||||
opts.type = HI_ALG_DSA;
|
||||
sprintf(opts.name, "%s-%d", basename, opts.bitsize);
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
if(do_sc_out)
|
||||
output_HI(root_node, &opts);
|
||||
else
|
||||
|
@ -924,7 +924,7 @@ int main(int argc, char *argv[])
|
|||
opts.type = HI_ALG_RSA;
|
||||
opts.bitsize = default_sizes[i];
|
||||
sprintf(opts.name, "%s-%d", basename, opts.bitsize);
|
||||
#ifdef SMA_CRAWLER
|
||||
#ifdef HIP_VPLS
|
||||
if(do_sc_out)
|
||||
output_HI(root_node, &opts);
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue