Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added pset into ioctl and set_mapping

  • Loading branch information...
commit 95d82f41bd574827ca29f097a7786932e70fce66 1 parent 6ad00c8
@gnocuil authored
Showing with 15 additions and 12 deletions.
  1. +1 −1  dhcp-4.2.3-P2/server/dhcp.c
  2. +14 −11 dhcp-4.2.3-P2/server/ioctl.h
View
2  dhcp-4.2.3-P2/server/dhcp.c
@@ -3350,7 +3350,7 @@ void dhcp_reply (lease)
{
inet_ntop(AF_INET6,&to4v6.sin6_addr,abuf, sizeof(abuf));
log_info("Bind %s to %s", inet_ntoa(raw.yiaddr),abuf);
- set_mapping(raw.yiaddr,to4v6.sin6_addr);
+ set_mapping(raw.yiaddr,to4v6.sin6_addr,lease->ip_pset);
}
result = send_packet6(state->ip,
(unsigned char *)&raw, packet_length, &to4v6);
View
25 dhcp-4.2.3-P2/server/ioctl.h
@@ -7,22 +7,23 @@
#define TUNNEL_DEVICE_NAME "public4over6"
-#define TUNNELMESSAGE SIOCDEVPRIVATE
-#define TUNNEL_MAPPING_NUM SIOCDEVPRIVATE+1//get the num of ecitems
-#define TUNNEL_MAPPING_INFO SIOCDEVPRIVATE+2//get the ecitems
-#define TUNNEL_MAC_MAPPING_NUM SIOCDEVPRIVATE+3//get the num of mac mappings
-#define TUNNEL_MAC_MAPPING_INFO SIOCDEVPRIVATE+4//get the mac mappings
-#define TUNNEL_DEL_ALL_MAPPING SIOCDEVPRIVATE+5//del all the ecitems
-#define TUNNEL_SET_MAPPING SIOCDEVPRIVATE+6//add or modify a ecitem
-#define TUNNEL_DEL_MAPPING SIOCDEVPRIVATE+7//del a ecitem
-#define TUNNEL_GET_BINDING SIOCDEVPRIVATE+8//get the tunnel binded info and ipv6.
+#define TUNNELMESSAGE SIOCDEVPRIVATE
+#define TUNNEL_MAPPING_NUM SIOCDEVPRIVATE+1//get the num of ecitems
+#define TUNNEL_MAPPING_INFO SIOCDEVPRIVATE+2//get the ecitems
+#define TUNNEL_MAC_MAPPING_NUM SIOCDEVPRIVATE+3//get the num of mac mappings
+#define TUNNEL_MAC_MAPPING_INFO SIOCDEVPRIVATE+4//get the mac mappings
+#define TUNNEL_DEL_ALL_MAPPING SIOCDEVPRIVATE+5//del all the ecitems
+#define TUNNEL_SET_MAPPING SIOCDEVPRIVATE+6//add or modify a ecitem
+#define TUNNEL_DEL_MAPPING SIOCDEVPRIVATE+7//del a ecitem
+#define TUNNEL_GET_BINDING SIOCDEVPRIVATE+8//get the tunnel binded info and ipv6.
#define TUNNEL_SET_BINDING SIOCDEVPRIVATE+9//set the tunnel to bind which interface.
-//public4over6 tunnel encapsulation item
+//public4over6 tunnel encapsulation item
struct ecitem
{
struct in_addr remote;
struct in6_addr remote6,local6;
+ unsigned short pset_index, pset_mask; //pset
struct timeval start_time;
int seconds;//lease time limit
long long in_pkts,inbound_bytes;
@@ -30,7 +31,7 @@ struct ecitem
int tag;//if tag==1,then this is manual,if tag==2,then this is auto.
struct ecitem *next;
};
-void set_mapping(struct in_addr remote,struct in6_addr remote6)
+void set_mapping(struct in_addr remote,struct in6_addr remote6, struct iaddr_pset ip_pset)
{
struct ecitem itm;
struct ifreq req;
@@ -45,6 +46,8 @@ void set_mapping(struct in_addr remote,struct in6_addr remote6)
memset(&itm,0,sizeof(struct ecitem));
itm.remote=remote;
itm.remote6=remote6;
+ itm.pset_index = ip_pset.pset_index;
+ itm.pset_mask = ip_pset.pset_mask;
itm.tag=2;//manual type,so we should do adjustment for the specified manual mapping item.
itm.seconds=5000;
memset(&req,0,sizeof(struct ifreq));
Please sign in to comment.
Something went wrong with that request. Please try again.