OSDN Git Service

Fix no pic
[uclinux-h8/uClinux-dist.git] / user / pptp / pptp_quirks.c
1 /* pptp_quirks.c ...... various options to fix quirks found in buggy adsl modems
2  *                      mulix <mulix@actcom.co.il>
3  *
4  * $Id: pptp_quirks.c,v 1.2 2001/11/23 03:42:51 quozl Exp $
5  */
6
7 #include <string.h>
8 #include "orckit_quirks.h"
9 #include "pptp_quirks.h"
10
11 static int quirk_index = -1;
12
13 struct pptp_fixup pptp_fixups[] = {
14     {BEZEQ_ISRAEL, ORCKIT, ORCKIT_ATUR3,
15      orckit_atur3_build_hook,
16      orckit_atur3_start_ctrl_conn_hook,
17      orckit_atur3_set_link_hook}
18 };
19
20 static int fixups_sz = sizeof(pptp_fixups)/sizeof(pptp_fixups[0]);
21
22 /* return 0 on success, non 0 otherwise */
23 int set_quirk_index(int index)
24 {
25     if (index >= 0 && index < fixups_sz) {
26         quirk_index = index;
27         return 0;
28     }
29
30     return -1;
31 }
32
33 int get_quirk_index()
34 {
35     return quirk_index;
36 }
37
38 /* return the index for this isp in the quirks table, -1 if not found */
39 int find_quirk(const char* isp_name)
40 {
41     int i = 0;
42     if (isp_name) {
43         while (i < fixups_sz && pptp_fixups[i].isp) {
44             if (!strcmp(pptp_fixups[i].isp, isp_name)) {
45                 return i;
46             }
47             ++i;
48         }
49     }
50
51     return -1;
52 }
53
54