summaryrefslogtreecommitdiff
path: root/accel-pppd/ppp/ppp_ifcfg.c
diff options
context:
space:
mode:
Diffstat (limited to 'accel-pppd/ppp/ppp_ifcfg.c')
-rw-r--r--accel-pppd/ppp/ppp_ifcfg.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/accel-pppd/ppp/ppp_ifcfg.c b/accel-pppd/ppp/ppp_ifcfg.c
index f916251d..bcad3f4b 100644
--- a/accel-pppd/ppp/ppp_ifcfg.c
+++ b/accel-pppd/ppp/ppp_ifcfg.c
@@ -59,52 +59,52 @@ void ppp_ifup(struct ppp_t *ppp)
struct npioctl np;
struct sockaddr_in addr;
- triton_event_fire(EV_PPP_ACCT_START, ppp);
+ triton_event_fire(EV_SES_ACCT_START, ppp);
if (ppp->stop_time)
return;
- triton_event_fire(EV_PPP_PRE_UP, ppp);
+ triton_event_fire(EV_SES_PRE_UP, ppp);
if (ppp->stop_time)
return;
memset(&ifr, 0, sizeof(ifr));
strcpy(ifr.ifr_name, ppp->ifname);
- if (ppp->ipv4) {
+ if (ppp->ses.ipv4) {
memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
- addr.sin_addr.s_addr = ppp->ipv4->addr;
+ addr.sin_addr.s_addr = ppp->ses.ipv4->addr;
memcpy(&ifr.ifr_addr,&addr,sizeof(addr));
if (ioctl(sock_fd, SIOCSIFADDR, &ifr))
log_ppp_error("ppp: failed to set IPv4 address: %s\n", strerror(errno));
- addr.sin_addr.s_addr = ppp->ipv4->peer_addr;
+ addr.sin_addr.s_addr = ppp->ses.ipv4->peer_addr;
memcpy(&ifr.ifr_dstaddr,&addr,sizeof(addr));
if (ioctl(sock_fd, SIOCSIFDSTADDR, &ifr))
log_ppp_error("ppp: failed to set peer IPv4 address: %s\n", strerror(errno));
}
- if (ppp->ipv6) {
+ if (ppp->ses.ipv6) {
devconf(ppp, "accept_ra", "0");
devconf(ppp, "autoconf", "0");
devconf(ppp, "forwarding", "1");
memset(&ifr6, 0, sizeof(ifr6));
ifr6.ifr6_addr.s6_addr32[0] = htons(0xfe80);
- *(uint64_t *)(ifr6.ifr6_addr.s6_addr + 8) = ppp->ipv6->intf_id;
+ *(uint64_t *)(ifr6.ifr6_addr.s6_addr + 8) = ppp->ses.ipv6->intf_id;
ifr6.ifr6_prefixlen = 64;
ifr6.ifr6_ifindex = ppp->ifindex;
if (ioctl(sock6_fd, SIOCSIFADDR, &ifr6))
log_ppp_error("ppp: faild to set LL IPv6 address: %s\n", strerror(errno));
- list_for_each_entry(a, &ppp->ipv6->addr_list, entry) {
+ list_for_each_entry(a, &ppp->ses.ipv6->addr_list, entry) {
if (a->prefix_len == 128)
continue;
- build_addr(a, ppp->ipv6->intf_id, &ifr6.ifr6_addr);
+ build_addr(a, ppp->ses.ipv6->intf_id, &ifr6.ifr6_addr);
ifr6.ifr6_prefixlen = a->prefix_len;
if (ioctl(sock6_fd, SIOCSIFADDR, &ifr6))
@@ -120,7 +120,7 @@ void ppp_ifup(struct ppp_t *ppp)
if (ioctl(sock_fd, SIOCSIFFLAGS, &ifr))
log_ppp_error("ppp: failed to set interface flags: %s\n", strerror(errno));
- if (ppp->ipv4) {
+ if (ppp->ses.ipv4) {
np.protocol = PPP_IP;
np.mode = NPMODE_PASS;
@@ -128,7 +128,7 @@ void ppp_ifup(struct ppp_t *ppp)
log_ppp_error("ppp: failed to set NP (IPv4) mode: %s\n", strerror(errno));
}
- if (ppp->ipv6) {
+ if (ppp->ses.ipv6) {
np.protocol = PPP_IPV6;
np.mode = NPMODE_PASS;
@@ -136,9 +136,9 @@ void ppp_ifup(struct ppp_t *ppp)
log_ppp_error("ppp: failed to set NP (IPv6) mode: %s\n", strerror(errno));
}
- ppp->ctrl->started(ppp);
+ ppp->ses.ctrl->started(ppp);
- triton_event_fire(EV_PPP_STARTED, ppp);
+ triton_event_fire(EV_SES_STARTED, ppp);
}
void __export ppp_ifdown(struct ppp_t *ppp)
@@ -152,27 +152,27 @@ void __export ppp_ifdown(struct ppp_t *ppp)
strcpy(ifr.ifr_name, ppp->ifname);
ioctl(sock_fd, SIOCSIFFLAGS, &ifr);
- if (ppp->ipv4) {
+ if (ppp->ses.ipv4) {
memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
memcpy(&ifr.ifr_addr,&addr,sizeof(addr));
ioctl(sock_fd, SIOCSIFADDR, &ifr);
}
- if (ppp->ipv6) {
+ if (ppp->ses.ipv6) {
memset(&ifr6, 0, sizeof(ifr6));
ifr6.ifr6_addr.s6_addr32[0] = htons(0xfe80);
- *(uint64_t *)(ifr6.ifr6_addr.s6_addr + 8) = ppp->ipv6->intf_id;
+ *(uint64_t *)(ifr6.ifr6_addr.s6_addr + 8) = ppp->ses.ipv6->intf_id;
ifr6.ifr6_prefixlen = 64;
ifr6.ifr6_ifindex = ppp->ifindex;
ioctl(sock6_fd, SIOCDIFADDR, &ifr6);
- list_for_each_entry(a, &ppp->ipv6->addr_list, entry) {
+ list_for_each_entry(a, &ppp->ses.ipv6->addr_list, entry) {
if (a->prefix_len == 128)
continue;
- build_addr(a, ppp->ipv6->intf_id, &ifr6.ifr6_addr);
+ build_addr(a, ppp->ses.ipv6->intf_id, &ifr6.ifr6_addr);
ifr6.ifr6_prefixlen = a->prefix_len;
ioctl(sock6_fd, SIOCDIFADDR, &ifr6);