summaryrefslogtreecommitdiff
path: root/accel-pppd/include/ppp_auth.h
blob: 839a88174cb0b5bc9d312c6907f5043808bf7385 (plain)
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
#ifndef PPP_AUTH_H
#define PPP_AUTH_H

#include "list.h"

struct ppp_auth_handler_t;

struct auth_data_t
{
	struct list_head entry;
	int proto;
	int state;
	struct ppp_auth_handler_t *h;
};

struct ppp_auth_handler_t
{
	struct list_head entry;
	const char *name;
	struct auth_data_t* (*init)(struct ppp_t*);
	int (*send_conf_req)(struct ppp_t*, struct auth_data_t*, uint8_t*);
	int (*recv_conf_req)(struct ppp_t*, struct auth_data_t*, uint8_t*);
	int (*start)(struct ppp_t*, struct auth_data_t*);
	int (*finish)(struct ppp_t*, struct auth_data_t*);
	void (*free)(struct ppp_t*,struct auth_data_t*);
	int (*check)(uint8_t *);
	int (*restart)(struct ppp_t*,struct auth_data_t*);
};

int ppp_auth_register_handler(struct ppp_auth_handler_t*);

int ppp_auth_succeeded(struct ppp_t *ppp, char *username);
void ppp_auth_failed(struct ppp_t *ppp, char *username);
int  ppp_auth_restart(struct ppp_t *ppp);

#endif