-
Notifications
You must be signed in to change notification settings - Fork 2
/
pptp_quirks.c
54 lines (43 loc) · 1.06 KB
/
pptp_quirks.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/* pptp_quirks.c ...... various options to fix quirks found in buggy adsl modems
* mulix <[email protected]>
*
* $Id: pptp_quirks.c,v 1.3 2011/12/19 07:15:03 quozl Exp $
*/
#include <string.h>
#include "orckit_quirks.h"
#include "pptp_quirks.h"
static int quirk_index = -1;
struct pptp_fixup pptp_fixups[] = {
{BEZEQ_ISRAEL, ORCKIT, ORCKIT_ATUR3,
orckit_atur3_build_hook,
orckit_atur3_start_ctrl_conn_hook,
orckit_atur3_set_link_hook}
};
static int fixups_sz = sizeof(pptp_fixups)/sizeof(pptp_fixups[0]);
/* return 0 on success, non 0 otherwise */
int set_quirk_index(int index)
{
if (index >= 0 && index < fixups_sz) {
quirk_index = index;
return 0;
}
return -1;
}
int get_quirk_index(void)
{
return quirk_index;
}
/* return the index for this isp in the quirks table, -1 if not found */
int find_quirk(const char* isp_name)
{
int i = 0;
if (isp_name) {
while (i < fixups_sz && pptp_fixups[i].isp) {
if (!strcmp(pptp_fixups[i].isp, isp_name)) {
return i;
}
++i;
}
}
return -1;
}