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
1865 1865
	char *ifname = NULL;
1866 1866
	char *parentifname = NULL;
1867 1867
	int ifname_len, parent_len;
1868
	long tag; 
1868
	long vid, pcp; 
1869 1869
	struct ifreq ifr;
1870 1870
	struct vlanreq params;
1871 1871

  
1872
	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssl", &ifname, &ifname_len, &parentifname, &parent_len, &tag) == FAILURE) {
1872
	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssll", &ifname, &ifname_len, &parentifname, &parent_len, &vid, &pcp) == FAILURE) {
1873 1873
		RETURN_NULL();
1874 1874
	}
1875 1875

  
......
1877 1877
	memset(&params, 0, sizeof(params));
1878 1878
	strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
1879 1879
	strlcpy(params.vlr_parent, parentifname, sizeof(params.vlr_parent));
1880
	params.vlr_tag = (u_short) tag;
1880
	params.vlr_vid = (u_short) vid;
1881
	params.vlr_pcp = (u_short) pcp;	
1881 1882
	ifr.ifr_data = (caddr_t) &params;
1882 1883
	if (ioctl(PFSENSE_G(s), SIOCSETVLAN, (caddr_t) &ifr) < 0)
1883 1884
		RETURN_NULL();
(3-3/4)