version 1.1.1.2, 2016/11/01 09:56:12
|
version 1.1.1.3, 2021/03/17 00:39:23
|
Line 89
|
Line 89
|
|
|
static void UdpDoClose(Link l); |
static void UdpDoClose(Link l); |
static void UdpShutdown(Link l); |
static void UdpShutdown(Link l); |
static int UdpSetCommand(Context ctx, int ac, char *av[], void *arg); | static int UdpSetCommand(Context ctx, int ac, const char *const av[], const void *arg); |
static void UdpNodeUpdate(Link l); |
static void UdpNodeUpdate(Link l); |
static int UdpListen(Link l); |
static int UdpListen(Link l); |
static int UdpUnListen(Link l); |
static int UdpUnListen(Link l); |
Line 129
|
Line 129
|
UdpSetCommand, NULL, 2, (void *) SET_ENABLE }, |
UdpSetCommand, NULL, 2, (void *) SET_ENABLE }, |
{ "disable [opt ...]", "Disable option", |
{ "disable [opt ...]", "Disable option", |
UdpSetCommand, NULL, 2, (void *) SET_DISABLE }, |
UdpSetCommand, NULL, 2, (void *) SET_DISABLE }, |
{ NULL }, | { NULL, NULL, NULL, NULL, 0, NULL }, |
}; |
}; |
|
|
struct UdpIf { |
struct UdpIf { |
Line 139 struct UdpIf {
|
Line 139 struct UdpIf {
|
int csock; /* netgraph Control socket */ |
int csock; /* netgraph Control socket */ |
EventRef ctrlEvent; /* listen for ctrl messages */ |
EventRef ctrlEvent; /* listen for ctrl messages */ |
}; |
}; |
struct UdpIf UdpIfs[UDP_MAXPARENTIFS]; | static struct UdpIf UdpIfs[UDP_MAXPARENTIFS]; |
|
|
int UdpListenUpdateSheduled=0; |
|
struct pppTimer UdpListenUpdateTimer; |
|
|
|
/* |
/* |
* INTERNAL VARIABLES |
* INTERNAL VARIABLES |
*/ |
*/ |
|
|
static struct confinfo gConfList[] = { | static const struct confinfo gConfList[] = { |
{ 0, UDP_CONF_RESOLVE_ONCE, "resolve-once" }, |
{ 0, UDP_CONF_RESOLVE_ONCE, "resolve-once" }, |
{ 0, 0, NULL }, |
{ 0, 0, NULL }, |
}; |
}; |
Line 272 UdpOpen(Link l)
|
Line 269 UdpOpen(Link l)
|
/* Setsockopt socket. */ |
/* Setsockopt socket. */ |
ksso->level=SOL_SOCKET; |
ksso->level=SOL_SOCKET; |
ksso->name=SO_REUSEPORT; |
ksso->name=SO_REUSEPORT; |
((int *)(ksso->value))[0]=1; | ((int *)(void *)(ksso->value))[0]=1; |
if (NgSendMsg(csock, path, NGM_KSOCKET_COOKIE, |
if (NgSendMsg(csock, path, NGM_KSOCKET_COOKIE, |
NGM_KSOCKET_SETOPT, &u, sizeof(u)) < 0) { |
NGM_KSOCKET_SETOPT, &u, sizeof(u)) < 0) { |
Perror("[%s] can't setsockopt() %s node", |
Perror("[%s] can't setsockopt() %s node", |
Line 358 UdpClose(Link l)
|
Line 355 UdpClose(Link l)
|
static void |
static void |
UdpShutdown(Link l) |
UdpShutdown(Link l) |
{ |
{ |
UdpInfo const pi = (UdpInfo) l->info; | UdpInfo const pi = (UdpInfo) l->info; |
|
|
if (pi->conf.fqdn_peer_addr) | if (pi->conf.fqdn_peer_addr) |
Freee(pi->conf.fqdn_peer_addr); | Freee(pi->conf.fqdn_peer_addr); |
|
|
UdpDoClose(l); |
UdpDoClose(l); |
UdpUnListen(l); |
UdpUnListen(l); |
Line 416 UdpOrigination(Link l)
|
Line 413 UdpOrigination(Link l)
|
static int |
static int |
UdpIsSync(Link l) |
UdpIsSync(Link l) |
{ |
{ |
|
(void)l; |
return (1); |
return (1); |
} |
} |
|
|
Line 734 UdpNodeUpdate(Link l)
|
Line 732 UdpNodeUpdate(Link l)
|
*/ |
*/ |
|
|
static int |
static int |
UdpSetCommand(Context ctx, int ac, char *av[], void *arg) | UdpSetCommand(Context ctx, int ac, const char *const av[], const void *arg) |
{ |
{ |
UdpInfo const pi = (UdpInfo) ctx->lnk->info; |
UdpInfo const pi = (UdpInfo) ctx->lnk->info; |
char **fqdn_peer_addr = &pi->conf.fqdn_peer_addr; |
char **fqdn_peer_addr = &pi->conf.fqdn_peer_addr; |