Changeset 265


Ignore:
Timestamp:
11/06/17 23:26:39 (2 weeks ago)
Author:
xchaos
Message:

qos free interface list (probably, not tested)

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ipstruct.h

    r256 r265  
    7373}; 
    7474 
     75struct QosFreeInterface 
     76{ 
     77 char *name; 
     78 int _eoln; 
     79 list(QosFreeInterface); 
     80}; 
     81 
    7582struct Index 
    7683{ 
  • trunk/prometheus.c

    r264 r265  
    6262char    *upstreamfile = "/etc/prometheus/upstream.interfaces"; /* list of interfaces to manage */ 
    6363char  *downstreamfile = "/etc/prometheus/downstream.interfaces"; /* list of interfaces to manage */ 
     64char     *qosfreefile = "/etc/prometheus/qosfree.interfaces"; /* list of interfaces to manage */ 
    6465char    *iptablesfile = "/var/spool/prometheus.iptables"; /* temporary file for iptables-restore*/ 
    6566char   *ip6tablesfile = "/var/spool/prometheus.ip6tables"; /* temporary file for ip6tables-restore*/ 
     
    139140struct Index *idxs = NULL, *idx, *metaindex; 
    140141struct Interface *interfaces = NULL, *interface; 
     142struct QosFreeInterface *qosfreeinterfaces = NULL, *qosfreeinterface; 
    141143 
    142144#define FREE_CLASS      3 
     
    291293  option("downstream-interfaces-list-filename",downstreamfile); 
    292294  option("upstream-interfaces-list-filename",upstreamfile); 
     295  option("qos-free-interfaces-list-filename",qosfreefile); 
    293296  option("macros-filename",macrosfile); 
    294297  option("ip6-prefix",ip6prefix); 
     
    567570 } 
    568571 done; /* ugly macro end */ 
    569  
    570572  
    571573 if(just_logs) 
     
    605607 string(str, STRLEN);  
    606608 string(limit_pkts, STRLEN); 
     609 
     610 /*-----------------------------------------------------------------*/ 
     611 printf("Parsing qos free interfaces file %s ...\n", qosfreefile); 
     612 /*-----------------------------------------------------------------*/ 
     613 load(qosfreeinterface, qosfreeinterfaces, 
     614      qosfreefile, QosFreeInterface, name); 
    607615 
    608616 /*-----------------------------------------------------------------*/ 
     
    755763    iptables_save_line(str, IPv4); 
    756764   } 
     765  } 
     766   
     767  for_each(qosfreeinterface, qosfreeinterfaces) 
     768  { 
     769    sprintf(str,"-A FORWARD -i %s -j ACCEPT", qosfreeinterface->name); 
     770    iptables_save_line(str, IPv4);   
     771    iptables_save_line(str, IPv6); 
     772    sprintf(str,"-A POSTROUTING -o %s -j ACCEPT", qosfreeinterface->name); 
     773    iptables_save_line(str, IPv4); 
     774    iptables_save_line(str, IPv6); 
    757775  } 
    758776   
Note: See TracChangeset for help on using the changeset viewer.