Project

General

Profile

Feature #4133 » pf_pcp_tools.diff

pfPorts patch (php55-pfSense-module) - Clement Barnier, 12/20/2014 08:34 AM

View differences:

/pfsense/tools/pfPorts/php55-pfSense-module/files/pfSense.c 2014-09-11 18:49:14.000000000 +0200
char *ifname = NULL;
char *parentifname = NULL;
int ifname_len, parent_len;
long tag;
long vid, pcp;
struct ifreq ifr;
struct vlanreq params;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssl", &ifname, &ifname_len, &parentifname, &parent_len, &tag) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssll", &ifname, &ifname_len, &parentifname, &parent_len, &vid, &pcp) == FAILURE) {
RETURN_NULL();
}
......
memset(&params, 0, sizeof(params));
strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
strlcpy(params.vlr_parent, parentifname, sizeof(params.vlr_parent));
params.vlr_tag = (u_short) tag;
params.vlr_vid = (u_short) vid;
params.vlr_pcp = (u_short) pcp;
ifr.ifr_data = (caddr_t) &params;
if (ioctl(PFSENSE_G(s), SIOCSETVLAN, (caddr_t) &ifr) < 0)
RETURN_NULL();
(3-3/4)