blob: 31f91720b6075857182a85eefedc722d4f85e268 [file] [log] [blame]
Ben Menchaca84f36632014-02-28 20:57:38 +00001/*
2 **************************************************************************
3 * Copyright (c) 2014, The Linux Foundation. All rights reserved.
4 * Permission to use, copy, modify, and/or distribute this software for
5 * any purpose with or without fee is hereby granted, provided that the
6 * above copyright notice and this permission notice appear in all copies.
7 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
8 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
10 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
12 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
13 * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
14 **************************************************************************
15 */
16
17/*
Gareth Williams6f96a4b2014-05-29 19:41:21 +010018 * ECM_INTERFACE_PPP_SUPPORT
19 * Comment this line out to disable support for working with PPP interfaces
20 *
21 * The ECM requires specific kernel API changes to work with PPP channels and channel type specific API's
22 * If your kernel does not have this support - or - you do not wish to support PPP interface types -
23 * comment this line out.
24 */
25#define ECM_INTERFACE_PPP_SUPPORT
26
27/*
Ben Menchaca84f36632014-02-28 20:57:38 +000028 * struct ecm_interface_route
29 * An ecm route supports either v4 or v6 routing information
30 */
31struct ecm_interface_route {
32 struct dst_entry *dst; /* Both ipv4 and v6 have a common dst entry */
33 union {
34 struct rtable *rtv4; /* IPv4 route */
35 struct rt6_info *rtv6; /* IPv6 route */
36 } rt;
37 bool v4_route; /* True when a v4 route, false when v6 */
38};
39
40/*
41 * External defined functions
42 */
43extern struct net_device *bond_get_tx_dev(struct sk_buff *skb, uint8_t *src_mac,
44 uint8_t *dst_mac, void *src,
45 void *dst, uint16_t protocol,
46 struct net_device *bond_dev);
47bool ecm_interface_mac_addr_get(ip_addr_t addr, uint8_t *mac_addr, bool *on_link, ip_addr_t gw_addr);
48bool ecm_interface_find_route_by_addr(ip_addr_t addr, struct ecm_interface_route *ecm_rt);
49void ecm_interface_route_release(struct ecm_interface_route *rt);
50struct ecm_db_iface_instance *ecm_interface_establish_and_ref(struct net_device *dev);
Tushar Mathur4ab0bf92014-06-10 20:37:07 +053051int32_t ecm_interface_heirarchy_construct(struct ecm_db_iface_instance *interfaces[], ip_addr_t packet_src_addr, ip_addr_t packet_dest_addr, int packet_protocol, struct net_device *given_dest_dev, bool is_routed, struct net_device *given_src_dev, uint8_t *dest_node_addr, uint8_t *src_node_addr);
Gareth Williamsadf425f2014-05-26 19:29:02 +010052void ecm_interface_stats_update(struct ecm_db_connection_instance *ci, uint32_t from_tx_packets, uint32_t from_tx_bytes, uint32_t from_rx_packets, uint32_t from_rx_bytes, uint32_t to_tx_packets, uint32_t to_tx_bytes, uint32_t to_rx_packets, uint32_t to_rx_bytes);
Gareth Williams46f4b5f2014-06-01 23:35:23 +010053struct net_device *ecm_interface_dev_find_by_addr(ip_addr_t addr, bool *from_local_addr);