forked from iqiyi/dpvs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request iqiyi#570 from iqiyi/devel
Devel
- Loading branch information
Showing
69 changed files
with
1,671 additions
and
3,805 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,59 @@ | ||
/* | ||
* DPVS is a software load balancer (Virtual Server) based on DPDK. | ||
* | ||
* Copyright (C) 2017 iQIYI (www.iqiyi.com). | ||
* All Rights Reserved. | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* as published by the Free Software Foundation; either version 2 | ||
* of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
*/ | ||
#ifndef __DPVS_IFTRAF_CONF_H__ | ||
#define __DPVS_IFTRAF_CONF_H__ | ||
#include <stdint.h> | ||
#include <linux/if_addr.h> | ||
#include "inet.h" | ||
|
||
enum { | ||
/* set */ | ||
SOCKOPT_SET_IFTRAF_ADD = 6400, | ||
SOCKOPT_SET_IFTRAF_DEL, | ||
|
||
/* get */ | ||
SOCKOPT_GET_IFTRAF_SHOW, | ||
}; | ||
|
||
struct dp_vs_iftraf_conf { | ||
char ifname[IFNAMSIZ]; | ||
} __attribute__((__packed__)); | ||
|
||
|
||
struct iftraf_param { | ||
uint8_t af; | ||
uint8_t proto; | ||
uint8_t cid; | ||
uint16_t devid; | ||
char ifname[IFNAMSIZ]; | ||
union inet_addr saddr; | ||
union inet_addr daddr; | ||
uint16_t sport; | ||
uint16_t dport; | ||
|
||
uint32_t total_recv; | ||
uint32_t total_sent; | ||
|
||
} __attribute__((__packed__)); | ||
|
||
struct iftraf_param_array { | ||
int ntrafs; | ||
struct iftraf_param iftraf[0]; | ||
}; | ||
|
||
#endif /* __DPVS_INETADDR_CONF_H__ */ | ||
|
||
/* | ||
* DPVS is a software load balancer (Virtual Server) based on DPDK. | ||
* | ||
* Copyright (C) 2017 iQIYI (www.iqiyi.com). | ||
* All Rights Reserved. | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* as published by the Free Software Foundation; either version 2 | ||
* of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
*/ | ||
#ifndef __DPVS_IFTRAF_CONF_H__ | ||
#define __DPVS_IFTRAF_CONF_H__ | ||
#include <stdint.h> | ||
#include <linux/if_addr.h> | ||
#include "inet.h" | ||
|
||
enum { | ||
/* set */ | ||
SOCKOPT_SET_IFTRAF_ADD = 6400, | ||
SOCKOPT_SET_IFTRAF_DEL, | ||
|
||
/* get */ | ||
SOCKOPT_GET_IFTRAF_SHOW, | ||
}; | ||
|
||
struct dp_vs_iftraf_conf { | ||
char ifname[IFNAMSIZ]; | ||
} __attribute__((__packed__)); | ||
|
||
|
||
struct iftraf_param { | ||
uint8_t af; | ||
uint8_t proto; | ||
uint8_t cid; | ||
uint16_t devid; | ||
char ifname[IFNAMSIZ]; | ||
union inet_addr saddr; | ||
union inet_addr daddr; | ||
uint16_t sport; | ||
uint16_t dport; | ||
|
||
uint32_t total_recv; | ||
uint32_t total_sent; | ||
|
||
} __attribute__((__packed__)); | ||
|
||
struct iftraf_param_array { | ||
int ntrafs; | ||
struct iftraf_param iftraf[0]; | ||
}; | ||
|
||
#endif /* __DPVS_INETADDR_CONF_H__ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,36 @@ | ||
/* | ||
* DPVS is a software load balancer (Virtual Server) based on DPDK. | ||
* | ||
* Copyright (C) 2017 iQIYI (www.iqiyi.com). | ||
* All Rights Reserved. | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* as published by the Free Software Foundation; either version 2 | ||
* of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
*/ | ||
#ifndef __IFTRAF_H__ | ||
#define __IFTRAF_H__ | ||
|
||
#include "conf/common.h" | ||
#include "list.h" | ||
#include "dpdk.h" | ||
#include "timer.h" | ||
#include "inet.h" | ||
#include "ctrl.h" | ||
|
||
int iftraf_sockopt_get(sockoptid_t opt, const void *conf, size_t size, void **out, size_t *outsize); | ||
|
||
int iftraf_pkt_in(int af, struct rte_mbuf *mbuf, struct netif_port *dev); | ||
int iftraf_pkt_out(int af, struct rte_mbuf *mbuf, struct netif_port *dev); | ||
|
||
int iftraf_init(void); | ||
int iftraf_term(void); /* cleanup */ | ||
|
||
#endif | ||
|
||
/* | ||
* DPVS is a software load balancer (Virtual Server) based on DPDK. | ||
* | ||
* Copyright (C) 2017 iQIYI (www.iqiyi.com). | ||
* All Rights Reserved. | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* as published by the Free Software Foundation; either version 2 | ||
* of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
*/ | ||
#ifndef __IFTRAF_H__ | ||
#define __IFTRAF_H__ | ||
|
||
#include "conf/common.h" | ||
#include "list.h" | ||
#include "dpdk.h" | ||
#include "timer.h" | ||
#include "inet.h" | ||
#include "ctrl.h" | ||
|
||
int iftraf_sockopt_get(sockoptid_t opt, const void *conf, size_t size, void **out, size_t *outsize); | ||
|
||
int iftraf_pkt_in(int af, struct rte_mbuf *mbuf, struct netif_port *dev); | ||
int iftraf_pkt_out(int af, struct rte_mbuf *mbuf, struct netif_port *dev); | ||
|
||
int iftraf_init(void); | ||
int iftraf_term(void); /* cleanup */ | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.