source: trunk/package/iproute2/patches/200-act_connmark.patch @ 25639

Last change on this file since 25639 was 25639, checked in by nbd, 5 years ago

kernel: add a new scheduler action for restoring the connection tracking mark - useful for ingress shaping, will be used for replacing IMQ later

File size: 1.9 KB
  • tc/Makefile

    a b TCMODULES += m_mirred.o 
    3636TCMODULES += m_nat.o 
    3737TCMODULES += m_pedit.o 
    3838TCMODULES += m_skbedit.o 
     39TCMODULES += m_connmark.o 
    3940TCMODULES += p_ip.o 
    4041TCMODULES += p_icmp.o 
    4142TCMODULES += p_tcp.o 
  • new file tc/m_connmark.c

    - +  
     1/* 
     2 * m_connmark.c         Connection tracking marking import 
     3 * 
     4 * Copyright (c) 2011 Felix Fietkau <nbd@openwrt.org> 
     5 * 
     6 * This program is free software; you can redistribute it and/or modify it 
     7 * under the terms and conditions of the GNU General Public License, 
     8 * version 2, as published by the Free Software Foundation. 
     9 * 
     10 * This program is distributed in the hope it will be useful, but WITHOUT 
     11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
     12 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for 
     13 * more details. 
     14 * 
     15 * You should have received a copy of the GNU General Public License along with 
     16 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple 
     17 * Place - Suite 330, Boston, MA 02111-1307 USA. 
     18 */ 
     19 
     20#include <stdio.h> 
     21#include <stdlib.h> 
     22#include <unistd.h> 
     23#include <string.h> 
     24#include "utils.h" 
     25#include "tc_util.h" 
     26 
     27static void 
     28explain(void) 
     29{ 
     30        fprintf(stderr, "Usage: ... connmark\n"); 
     31} 
     32 
     33static void 
     34usage(void) 
     35{ 
     36        explain(); 
     37        exit(-1); 
     38} 
     39 
     40static int 
     41parse_connmark(struct action_util *a, int *argc_p, char ***argv_p, int tca_id, 
     42              struct nlmsghdr *n) 
     43{ 
     44        int argc = *argc_p; 
     45        char **argv = *argv_p; 
     46 
     47        if (matches(*argv, "connmark") != 0) 
     48                return -1; 
     49 
     50        NEXT_ARG(); 
     51 
     52        *argc_p = argc; 
     53        *argv_p = argv; 
     54        return 0; 
     55} 
     56 
     57static int print_connmark(struct action_util *au, FILE *f, struct rtattr *arg) 
     58{ 
     59        if (arg == NULL) 
     60                return -1; 
     61 
     62        fprintf(f, " connmark"); 
     63 
     64        return 0; 
     65} 
     66 
     67struct action_util connmark_action_util = { 
     68        .id = "connmark", 
     69        .parse_aopt = parse_connmark, 
     70        .print_aopt = print_connmark, 
     71}; 
Note: See TracBrowser for help on using the repository browser.