Skip to content

Commit

Permalink
Revert "Experimental libpcap-based network meter code for VPCMIDO mod…
Browse files Browse the repository at this point in the history
…e - EUCA-13283"

This reverts commit 49342bf.
  • Loading branch information
sjones4 committed Nov 30, 2017
1 parent 2af95f2 commit 551fa77
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 1,780 deletions.
10 changes: 0 additions & 10 deletions net/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ include ../Makedefs

# Standard Libraries, Dependencies and Includes
STDLIBS := -lpthread -lm -lssl -lxml2 -lcurl -lcrypto -ljson -ljson-c
PCAPLIB := -lpcap
STDDEPS := ../util/sequence_executor.o ../util/atomic_file.o ../util/log.o ../util/ipc.o ../util/misc.o
STDDEPS += ../util/euca_string.o ../util/euca_file.o ../util/hash.o ../util/fault.o ../util/wc.o ../util/utf8.o
STDDEPS += ../util/euca_auth.o ../storage/diskutil.o ../storage/http.o ../util/config.o ../util/euca_network.o
Expand All @@ -92,12 +91,6 @@ EUCANETDOBJS := $(EUCANETD:=.o)
EUCANETDDEPS := $(EUCANETDOBJS) $(LIBNETNAME) $(STDDEPS)
EUCANETDNAME := eucanetd

# eucanetd meter component
EUCANETDMETER := eucanetd_meter
EUCANETDMETEROBJS := $(EUCANETDMETER:=.o)
EUCANETDMETERDEPS := $(EUCANETDMETEROBJS) $(LIBNETNAME) $(STDDEPS)
EUCANETDMETERNAME := eucanetd_meter

# The EUCA_ARP Cloud Component
EUCAARP := euca_arp
EUCAARPOBJS := $(EUCAARP:=.o)
Expand All @@ -120,9 +113,6 @@ $(LIBNETNAME): $(LIBNETDEPS)

$(EUCANETDNAME): $(EUCANETDDEPS)
$(CC) -o $@ $(EUCANETDDEPS) $(LIBNETNAME) $(STDLIBS)

$(EUCANETDMETERNAME): $(EUCANETDMETERDEPS)
$(CC) -o $@ $(EUCANETDMETERDEPS) $(LIBNETNAME) $(STDLIBS) $(PCAPLIB)

$(EUCAARPNAME): $(EUCAARPDEPS)
$(CC) -o $@ $(EUCAARPDEPS) $(STDLIBS)
Expand Down
89 changes: 1 addition & 88 deletions net/euca_gni.c
Original file line number Diff line number Diff line change
Expand Up @@ -534,42 +534,6 @@ int gni_find_instance(globalNetworkInfo *gni, const char *psInstanceId, gni_inst
return (1);
}

/**
* Searches for the given interface name and returns the associated gni_instance structure.
* @param gni [in] pointer to the global network information structure.
* @param psInstanceId [in] the ID string of the interface of interest.
* @param pInstance [out] pointer to the gni_instance structure of interest.
* @return 0 on success. Positive integer otherwise.
*/
int gni_find_interface(globalNetworkInfo *gni, const char *psInstanceId, gni_instance ** pInstance) {
if (!gni || !psInstanceId || !pInstance) {
LOGWARN("invalid argument: cannot find instance from NULL\n");
return (1);
}
// Initialize to NULL
(*pInstance) = NULL;

LOGTRACE("attempting search for interface id %s in gni\n", psInstanceId);

if (gni->sorted_ifs == FALSE) {
qsort(gni->ifs, gni->max_ifs,
sizeof (gni_instance *), compare_gni_interface_name);
gni->sorted_ifs = TRUE;
}
gni_instance inst;
snprintf(inst.name, INTERFACE_ID_LEN, "%s", psInstanceId);
gni_instance *pinst = &inst;
gni_instance **res = (gni_instance **) bsearch(&pinst,
gni->ifs, gni->max_ifs,
sizeof (gni_instance *), compare_gni_interface_name);
if (res) {
*pInstance = *res;
return (0);
}

return (1);
}

/**
* Searches through the list of network interfaces in the gni and returns all
* non-primary interfaces for a given instance
Expand Down Expand Up @@ -5158,7 +5122,7 @@ int gni_validate(globalNetworkInfo *gni) {
}
}
}

// No VPC elements are expected in EDGE mode
if (gni->max_vpcs || gni->max_dhcpos || gni->max_vpcIgws) {
LOGERROR("Invalid GNI (%s): VPC elements found in EDGE mode gni\n", gni->version);
Expand Down Expand Up @@ -6259,7 +6223,6 @@ int cmp_gni_vpcsubnet(gni_vpcsubnet *a, gni_vpcsubnet *b, int *nacl_diff) {
}
}
if ((!strcmp(a->routeTable_name, b->routeTable_name)) &&
(!strcmp(a->networkAcl_name, b->networkAcl_name)) &&
(!cmp_gni_route_table(a->routeTable, b->routeTable))) {
return (0);
}
Expand Down Expand Up @@ -6721,53 +6684,3 @@ int compare_gni_instance_name(const void *p1, const void *p2) {
return (strcmp(name1, name2));
}

/**
* Comparator function for gni_instance structures. Used for ENIs. Comparison is
* base on name and/or ifname property.
* @param p1 [in] pointer to gni_instance pointer 1.
* @param p2 [in] pointer to gni_instance pointer 2.
* @return 0 iff p1->.->name == p2->.->(if)name. -1 iff p1->.->name < p2->.->(if)name.
* 1 iff p1->.->name > p2->.->(if)name.
* NULL is considered larger than a non-NULL string.
*/
int compare_gni_interface_name(const void *p1, const void *p2) {
gni_instance **pp1 = NULL;
gni_instance **pp2 = NULL;
gni_instance *e1 = NULL;
gni_instance *e2 = NULL;
char *name1 = NULL;
char *name2 = NULL;
char *ifname2 = NULL;

if ((p1 == NULL) || (p2 == NULL)) {
LOGWARN("Invalid argument: cannot compare NULL gni_instance\n");
return (0);
}
pp1 = (gni_instance **) p1;
pp2 = (gni_instance **) p2;
e1 = *pp1;
e2 = *pp2;
if (e1 && strlen(e1->name)) {
name1 = e1->name;
}
if (e2 && strlen(e2->name)) {
name2 = e2->name;
}
if (e2 && strlen(e2->ifname)) {
ifname2 = e2->ifname;
}
if (name1 == name2) {
return (0);
}
if (name1 == NULL) {
return (1);
}
if (name2 == NULL) {
return (-1);
}
if (!strcmp(name1, ifname2)) {
return (0);
}
return (strcmp(name1, name2));
}

3 changes: 0 additions & 3 deletions net/euca_gni.h
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,6 @@ typedef struct globalNetworkInfo_t {
boolean sorted_instances;
gni_instance **ifs; //!< List of interfaces information
int max_ifs; //!< Number of interfaces in the list
boolean sorted_ifs;
gni_secgroup *secgroups; //!< List of security group information
int max_secgroups; //!< Number of security groups in the list
gni_vpc *vpcs; //!< List of VPC information
Expand Down Expand Up @@ -433,7 +432,6 @@ int gni_find_self_node(globalNetworkInfo *gni, gni_node **outnodeptr);
int gni_find_self_cluster(globalNetworkInfo *gni, gni_cluster **outclusterptr);
int gni_find_secgroup(globalNetworkInfo *gni, const char *psGroupId, gni_secgroup **pSecGroup);
int gni_find_instance(globalNetworkInfo *gni, const char *psInstanceId, gni_instance **pInstance);
int gni_find_interface(globalNetworkInfo *gni, const char *psInstanceId, gni_instance **pInstance);
int gni_find_secondary_interfaces(globalNetworkInfo *gni, const char *psInstanceId, gni_instance *pAInstances[], int *size);

int gni_cloud_get_clusters(globalNetworkInfo *gni, char **cluster_names, int max_cluster_names, char ***out_cluster_names, int *out_max_cluster_names, gni_cluster **out_clusters,
Expand Down Expand Up @@ -526,7 +524,6 @@ int ruleconvert(char *rulebuf, char *outrule);
int ingress_gni_to_iptables_rule(char *scidr, gni_rule *iggnirule, char *outrule, int flags);

int compare_gni_instance_name(const void *p1, const void *p2);
int compare_gni_interface_name(const void *p1, const void *p2);

/*----------------------------------------------------------------------------*\
| |
Expand Down
Loading

0 comments on commit 551fa77

Please sign in to comment.