batman_ogm_packet->flags &= ~VIS_SERVER;
if ((hard_iface == primary_if) &&
- (atomic_read(&bat_priv->gw_mode) == GW_MODE_SERVER))
+ (atomic_read(&bat_priv->gw_mode) == BATADV_GW_MODE_SERVER))
batman_ogm_packet->gw_flags =
(uint8_t)atomic_read(&bat_priv->gw_bandwidth);
else
/* restart gateway selection if fast or late switching was enabled */
if ((orig_node->gw_flags) &&
- (atomic_read(&bat_priv->gw_mode) == GW_MODE_CLIENT) &&
+ (atomic_read(&bat_priv->gw_mode) == BATADV_GW_MODE_CLIENT) &&
(atomic_read(&bat_priv->gw_sel_class) > 2))
batadv_gw_check_election(bat_priv, orig_node);
int bytes_written;
switch (atomic_read(&bat_priv->gw_mode)) {
- case GW_MODE_CLIENT:
+ case BATADV_GW_MODE_CLIENT:
bytes_written = sprintf(buff, "%s\n",
BATADV_GW_MODE_CLIENT_NAME);
break;
- case GW_MODE_SERVER:
+ case BATADV_GW_MODE_SERVER:
bytes_written = sprintf(buff, "%s\n",
BATADV_GW_MODE_SERVER_NAME);
break;
if (strncmp(buff, BATADV_GW_MODE_OFF_NAME,
strlen(BATADV_GW_MODE_OFF_NAME)) == 0)
- gw_mode_tmp = GW_MODE_OFF;
+ gw_mode_tmp = BATADV_GW_MODE_OFF;
if (strncmp(buff, BATADV_GW_MODE_CLIENT_NAME,
strlen(BATADV_GW_MODE_CLIENT_NAME)) == 0)
- gw_mode_tmp = GW_MODE_CLIENT;
+ gw_mode_tmp = BATADV_GW_MODE_CLIENT;
if (strncmp(buff, BATADV_GW_MODE_SERVER_NAME,
strlen(BATADV_GW_MODE_SERVER_NAME)) == 0)
- gw_mode_tmp = GW_MODE_SERVER;
+ gw_mode_tmp = BATADV_GW_MODE_SERVER;
if (gw_mode_tmp < 0) {
batadv_info(net_dev,
return count;
switch (atomic_read(&bat_priv->gw_mode)) {
- case GW_MODE_CLIENT:
+ case BATADV_GW_MODE_CLIENT:
curr_gw_mode_str = BATADV_GW_MODE_CLIENT_NAME;
break;
- case GW_MODE_SERVER:
+ case BATADV_GW_MODE_SERVER:
curr_gw_mode_str = BATADV_GW_MODE_SERVER_NAME;
break;
default:
* hear about. This check is based on the daemon's uptime which we
* don't have.
*/
- if (atomic_read(&bat_priv->gw_mode) != GW_MODE_CLIENT)
+ if (atomic_read(&bat_priv->gw_mode) != BATADV_GW_MODE_CLIENT)
goto out;
if (!batadv_atomic_dec_not_zero(&bat_priv->gw_reselect))
goto out;
switch (atomic_read(&bat_priv->gw_mode)) {
- case GW_MODE_SERVER:
+ case BATADV_GW_MODE_SERVER:
/* If we are a GW then we are our best GW. We can artificially
* set the tq towards ourself as the maximum value
*/
curr_tq_avg = BATADV_TQ_MAX_VALUE;
break;
- case GW_MODE_CLIENT:
+ case BATADV_GW_MODE_CLIENT:
curr_gw = batadv_gw_get_selected_gw_node(bat_priv);
if (!curr_gw)
goto out;
curr_tq_avg = neigh_curr->tq_avg;
break;
- case GW_MODE_OFF:
+ case BATADV_GW_MODE_OFF:
default:
goto out;
}
#ifndef _NET_BATMAN_ADV_GATEWAY_COMMON_H_
#define _NET_BATMAN_ADV_GATEWAY_COMMON_H_
-enum gw_modes {
- GW_MODE_OFF,
- GW_MODE_CLIENT,
- GW_MODE_SERVER,
+enum batadv_gw_modes {
+ BATADV_GW_MODE_OFF,
+ BATADV_GW_MODE_CLIENT,
+ BATADV_GW_MODE_SERVER,
};
#define BATADV_GW_MODE_OFF_NAME "off"
do_bcast = true;
switch (atomic_read(&bat_priv->gw_mode)) {
- case GW_MODE_SERVER:
+ case BATADV_GW_MODE_SERVER:
/* gateway servers should not send dhcp
* requests into the mesh
*/
if (ret)
goto dropped;
break;
- case GW_MODE_CLIENT:
+ case BATADV_GW_MODE_CLIENT:
/* gateway clients should send dhcp requests
* via unicast to their gateway
*/
if (ret)
do_bcast = false;
break;
- case GW_MODE_OFF:
+ case BATADV_GW_MODE_OFF:
default:
break;
}
/* unicast packet */
} else {
- if (atomic_read(&bat_priv->gw_mode) != GW_MODE_OFF) {
+ if (atomic_read(&bat_priv->gw_mode) != BATADV_GW_MODE_OFF) {
ret = batadv_gw_out_of_range(bat_priv, skb, ethhdr);
if (ret)
goto dropped;
atomic_set(&bat_priv->bridge_loop_avoidance, 0);
atomic_set(&bat_priv->ap_isolation, 0);
atomic_set(&bat_priv->vis_mode, VIS_TYPE_CLIENT_UPDATE);
- atomic_set(&bat_priv->gw_mode, GW_MODE_OFF);
+ atomic_set(&bat_priv->gw_mode, BATADV_GW_MODE_OFF);
atomic_set(&bat_priv->gw_sel_class, 20);
atomic_set(&bat_priv->gw_bandwidth, 41);
atomic_set(&bat_priv->orig_interval, 1000);