Mercurial > dropbear
comparison listener.h @ 1460:58a74cb829b8
Pointer parameter could be declared as pointing to const (callback)
author | Francois Perrad <francois.perrad@gadz.org> |
---|---|
date | Sat, 19 Aug 2017 22:39:53 +0200 |
parents | 06d52bcb8094 |
children |
comparison
equal
deleted
inserted
replaced
1459:06d52bcb8094 | 1460:58a74cb829b8 |
---|---|
33 int socks[DROPBEAR_MAX_SOCKS]; | 33 int socks[DROPBEAR_MAX_SOCKS]; |
34 unsigned int nsocks; | 34 unsigned int nsocks; |
35 | 35 |
36 int index; /* index in the array of listeners */ | 36 int index; /* index in the array of listeners */ |
37 | 37 |
38 void (*acceptor)(struct Listener*, int sock); | 38 void (*acceptor)(const struct Listener*, int sock); |
39 void (*cleanup)(struct Listener*); | 39 void (*cleanup)(const struct Listener*); |
40 | 40 |
41 int type; /* CHANNEL_ID_X11, CHANNEL_ID_AGENT, | 41 int type; /* CHANNEL_ID_X11, CHANNEL_ID_AGENT, |
42 CHANNEL_ID_TCPDIRECT (for clients), | 42 CHANNEL_ID_TCPDIRECT (for clients), |
43 CHANNEL_ID_TCPFORWARDED (for servers) */ | 43 CHANNEL_ID_TCPFORWARDED (for servers) */ |
44 | 44 |
50 void handle_listeners(const fd_set * readfds); | 50 void handle_listeners(const fd_set * readfds); |
51 void set_listener_fds(fd_set * readfds); | 51 void set_listener_fds(fd_set * readfds); |
52 | 52 |
53 struct Listener* new_listener(const int socks[], unsigned int nsocks, | 53 struct Listener* new_listener(const int socks[], unsigned int nsocks, |
54 int type, void* typedata, | 54 int type, void* typedata, |
55 void (*acceptor)(struct Listener* listener, int sock), | 55 void (*acceptor)(const struct Listener* listener, int sock), |
56 void (*cleanup)(struct Listener*)); | 56 void (*cleanup)(const struct Listener*)); |
57 | 57 |
58 struct Listener * get_listener(int type, void* typedata, | 58 struct Listener * get_listener(int type, const void* typedata, |
59 int (*match)(void*, void*)); | 59 int (*match)(const void*, const void*)); |
60 | 60 |
61 void remove_listener(struct Listener* listener); | 61 void remove_listener(struct Listener* listener); |
62 | 62 |
63 void remove_all_listeners(void); | 63 void remove_all_listeners(void); |
64 | 64 |