/* * Copyright (c) 2019 AVM GmbH . * * 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. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include /* types to be completed by backend */ enum hwpa_backend_rv; /* implementations required by backend */ enum hwpa_backend_rv hwpa_backend_add_session(const struct avm_pa_session *s, unsigned long *handle_out); enum hwpa_backend_rv hwpa_backend_rem_session(unsigned long handle); enum hwpa_backend_rv hwpa_backend_stats(unsigned long handle, struct avm_pa_session_stats *stats); enum hwpa_backend_rv hwpa_backend_init(void); void hwpa_backend_exit(void); #if IS_ENABLED(CONFIG_GRX5_AVM_FRITZ_BOX) #include "hwpa_grx.h" #elif IS_ENABLED(CONFIG_PRX_AVM_FRITZ_BOX) #include "hwpa_prx.h" #else #error This library only supports grx and prx platforms. #endif /* valid match_info defaults */ #ifndef HWPA_VALID_L2 #define HWPA_VALID_L2 \ { { .type = AVM_PA_NUM_MATCH_TYPES } }, \ \ { { .type = AVM_PA_ETH }, { .type = AVM_PA_NUM_MATCH_TYPES } }, \ \ { { .type = AVM_PA_ETH }, \ { .type = AVM_PA_VLAN }, \ { .type = AVM_PA_NUM_MATCH_TYPES } }, \ \ { { .type = AVM_PA_ETH }, \ { .type = AVM_PA_PPPOE }, \ { .type = AVM_PA_PPP }, \ { .type = AVM_PA_NUM_MATCH_TYPES } }, \ \ { { .type = AVM_PA_ETH }, \ { .type = AVM_PA_VLAN }, \ { .type = AVM_PA_PPPOE }, \ { .type = AVM_PA_PPP }, \ { .type = AVM_PA_NUM_MATCH_TYPES } }, #endif #ifndef HWPA_VALID_L3 #define HWPA_VALID_L3 \ { { .type = AVM_PA_IPV4 }, \ { .type = AVM_PA_PORTS }, \ { .type = AVM_PA_NUM_MATCH_TYPES } }, \ \ { { .type = AVM_PA_IPV6 }, \ { .type = AVM_PA_PORTS }, \ { .type = AVM_PA_NUM_MATCH_TYPES } }, #endif #ifndef HWPA_VALID_L3_L2ENCAP #define HWPA_VALID_L3_L2ENCAP \ { { .type = AVM_PA_IPV4 }, \ { .type = AVM_PA_L2TP }, \ { .type = AVM_PA_NUM_MATCH_TYPES } }, #endif #ifndef HWPA_VALID_L3_L3ENCAP #define HWPA_VALID_L3_L3ENCAP \ /* dslite */ \ { { .type = AVM_PA_IPV6 }, { .type = AVM_PA_NUM_MATCH_TYPES } }, #endif