Changeset 819 for trunk


Ignore:
Timestamp:
Nov 29, 2016, 11:00:08 PM (3 years ago)
Author:
amain
Message:

swconfig: update patches

Location:
trunk/debian/packages/swconfig/trunk/debian
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/debian/packages/swconfig/trunk/debian/changelog

    r810 r819  
     1swconfig (0.0.11-2~debwrtSID+1.1) sid-debwrt-unstable; urgency=medium
     2
     3  * Upstream update 11
     4
     5 -- Johan van Zoomeren <amain@dev3>  Tue, 29 Nov 2016 22:52:08 +0100
     6
    17swconfig (0.0.10-2~debwrt70+1) wheezy-debwrt-unstable; urgency=medium
    28
  • trunk/debian/packages/swconfig/trunk/debian/patches/002_debwrt_cli.c.patch

    r810 r819  
    11Author: Johan van Zoomeren <amain@debwrt.net>
    22
    3 --- swconfig-47459.orig/src/cli.c
    4 +++ swconfig-47459/src/cli.c
     3Index: swconfig-0.0.10/src/cli.c
     4===================================================================
     5--- swconfig-0.0.10.orig/src/cli.c
     6+++ swconfig-0.0.10/src/cli.c
    57@@ -23,7 +23,7 @@
    68 #include <getopt.h>
     
    1214 #include <linux/types.h>
    1315 #include <linux/netlink.h>
    14 @@ -173,6 +173,7 @@ print_usage(void)
     16@@ -206,6 +206,7 @@ print_usage(void)
    1517        exit(1);
    1618 }
     
    2022 swconfig_load_uci(struct switch_dev *dev, const char *name)
    2123 {
    22 @@ -197,7 +198,7 @@ swconfig_load_uci(struct switch_dev *dev
     24@@ -230,7 +231,7 @@ swconfig_load_uci(struct switch_dev *dev
    2325 out:
    2426        uci_free_context(ctx);
     
    2931 int main(int argc, char **argv)
    3032 {
    31 @@ -324,7 +325,7 @@ int main(int argc, char **argv)
     33@@ -357,7 +358,7 @@ int main(int argc, char **argv)
    3234                putchar('\n');
    3335                break;
     
    3840        case CMD_HELP:
    3941                list_attributes(dev);
     42Index: swconfig-0.0.10/src/cli.c.orig
     43===================================================================
    4044--- /dev/null
    41 +++ swconfig-47459/src/cli.c.orig
     45+++ swconfig-0.0.10/src/cli.c.orig
    4246@@ -0,0 +1,354 @@
    4347+/*
  • trunk/debian/packages/swconfig/trunk/debian/patches/003_debwrt_swlib.h.patch

    r810 r819  
    11Author: Johan van Zoomeren <amain@debwrt.net>
    22
    3 --- swconfig-47459.orig/src/swlib.h
    4 +++ swconfig-47459/src/swlib.h
     3Index: swconfig-0.0.11/src/swlib.h
     4===================================================================
     5--- swconfig-0.0.11.orig/src/swlib.h
     6+++ swconfig-0.0.11/src/swlib.h
    57@@ -111,7 +111,7 @@ struct switch_attr;
    68 struct switch_port;
     
    2022 
    2123 #endif
    22 --- /dev/null
    23 +++ swconfig-47459/src/swlib.h.orig
    24 @@ -0,0 +1,252 @@
    25 +/*
    26 + * swlib.h: Switch configuration API (user space part)
    27 + *
    28 + * Copyright (C) 2008-2009 Felix Fietkau <nbd@openwrt.org>
    29 + *
    30 + * This program is free software; you can redistribute it and/or
    31 + * modify it under the terms of the GNU Lesser General Public License
    32 + * version 2.1 as published by the Free Software Foundation.
    33 + *
    34 + * This program is distributed in the hope that it will be useful,
    35 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    36 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    37 + * GNU General Public License for more details.
    38 + *
    39 +
    40 +Usage of the library functions:
    41 +
    42 +  The main datastructure for a switch is the struct switch_device
    43 +  To get started, you first need to use switch_connect() to probe
    44 +  for switches and allocate an instance of this struct.
    45 +
    46 +  There are two possible usage modes:
    47 +    dev = switch_connect("eth0");
    48 +      - this call will look for a switch registered for the linux device
    49 +         "eth0" and only allocate a switch_device for this particular switch.
    50 +
    51 +    dev = switch_connect(NULL)
    52 +      - this will return one switch_device struct for each available
    53 +         switch. The switch_device structs are chained with by ->next pointer
    54 +
    55 +  Then to query a switch for all available attributes, use:
    56 +    swlib_scan(dev);
    57 +
    58 +  All allocated datastructures for the switch_device struct can be freed with
    59 +    swlib_free(dev);
    60 +  or
    61 +    swlib_free_all(dev);
    62 +
    63 +  The latter traverses a whole chain of switch_device structs and frees them all
    64 +
    65 +  Switch attributes (struct switch_attr) are divided into three groups:
    66 +    dev->ops:
    67 +      - global settings
    68 +    dev->port_ops:
    69 +      - per-port settings
    70 +    dev->vlan_ops:
    71 +      - per-vlan settings
    72 +
    73 +  switch_lookup_attr() is a small helper function to locate attributes
    74 +  by name.
    75 +
    76 +  switch_set_attr() and switch_get_attr() can alter or request the values
    77 +  of attributes.
    78 +
    79 +Usage of the switch_attr struct:
    80 +
    81 +  ->atype: attribute group, one of:
    82 +    - SWLIB_ATTR_GROUP_GLOBAL
    83 +    - SWLIB_ATTR_GROUP_VLAN
    84 +    - SWLIB_ATTR_GROUP_PORT
    85 +
    86 +  ->id: identifier for the attribute
    87 +
    88 +  ->type: data type, one of:
    89 +    - SWITCH_TYPE_INT
    90 +    - SWITCH_TYPE_STRING
    91 +    - SWITCH_TYPE_PORT
    92 +
    93 +  ->name: short name of the attribute
    94 +  ->description: longer description
    95 +  ->next: pointer to the next attribute of the current group
    96 +
    97 +
    98 +Usage of the switch_val struct:
    99 +
    100 +  When setting attributes, following members of the struct switch_val need
    101 +  to be set up:
    102 +
    103 +    ->len (for attr->type == SWITCH_TYPE_PORT)
    104 +    ->port_vlan:
    105 +      - port number (for attr->atype == SWLIB_ATTR_GROUP_PORT), or:
    106 +      - vlan number (for attr->atype == SWLIB_ATTR_GROUP_VLAN)
    107 +    ->value.i (for attr->type == SWITCH_TYPE_INT)
    108 +    ->value.s (for attr->type == SWITCH_TYPE_STRING)
    109 +      - owned by the caller, not stored in the library internally
    110 +    ->value.ports (for attr->type == SWITCH_TYPE_PORT)
    111 +      - must point to an array of at lest val->len * sizeof(struct switch_port)
    112 +
    113 +  When getting string attributes, val->value.s must be freed by the caller
    114 +  When getting port list attributes, an internal static buffer is used,
    115 +  which changes from call to call.
    116 +
    117 + */
    118 +
    119 +#ifndef __SWLIB_H
    120 +#define __SWLIB_H
    121 +
    122 +enum swlib_attr_group {
    123 +       SWLIB_ATTR_GROUP_GLOBAL,
    124 +       SWLIB_ATTR_GROUP_VLAN,
    125 +       SWLIB_ATTR_GROUP_PORT,
    126 +};
    127 +
    128 +enum swlib_port_flags {
    129 +       SWLIB_PORT_FLAG_TAGGED = (1 << 0),
    130 +};
    131 +
    132 +
    133 +struct switch_dev;
    134 +struct switch_attr;
    135 +struct switch_port;
    136 +struct switch_port_map;
    137 +struct switch_val;
    138 +struct uci_package;
    139 +
    140 +struct switch_dev {
    141 +       int id;
    142 +       char dev_name[IFNAMSIZ];
    143 +       char *name;
    144 +       char *alias;
    145 +       int ports;
    146 +       int vlans;
    147 +       int cpu_port;
    148 +       struct switch_attr *ops;
    149 +       struct switch_attr *port_ops;
    150 +       struct switch_attr *vlan_ops;
    151 +       struct switch_portmap *maps;
    152 +       struct switch_dev *next;
    153 +       void *priv;
    154 +};
    155 +
    156 +struct switch_val {
    157 +       struct switch_attr *attr;
    158 +       int len;
    159 +       int err;
    160 +       int port_vlan;
    161 +       union {
    162 +               char *s;
    163 +               int i;
    164 +               struct switch_port *ports;
    165 +       } value;
    166 +};
    167 +
    168 +struct switch_attr {
    169 +       struct switch_dev *dev;
    170 +       int atype;
    171 +       int id;
    172 +       int type;
    173 +       char *name;
    174 +       char *description;
    175 +       struct switch_attr *next;
    176 +};
    177 +
    178 +struct switch_port {
    179 +       unsigned int id;
    180 +       unsigned int flags;
    181 +};
    182 +
    183 +struct switch_portmap {
    184 +       unsigned int virt;
    185 +       char *segment;
    186 +};
    187 +
    188 +/**
    189 + * swlib_list: list all switches
    190 + */
    191 +void swlib_list(void);
    192 +
    193 +/**
    194 + * swlib_print_portmap: get portmap
    195 + * @dev: switch device struct
    196 + */
    197 +void swlib_print_portmap(struct switch_dev *dev, char *segment);
    198 +
    199 +/**
    200 + * swlib_connect: connect to the switch through netlink
    201 + * @name: name of the ethernet interface,
    202 + *
    203 + * if name is NULL, it connect and builds a chain of all switches
    204 + */
    205 +struct switch_dev *swlib_connect(const char *name);
    206 +
    207 +/**
    208 + * swlib_free: free all dynamically allocated data for the switch connection
    209 + * @dev: switch device struct
    210 + *
    211 + * all members of a switch device chain (generated by swlib_connect(NULL))
    212 + * must be freed individually
    213 + */
    214 +void swlib_free(struct switch_dev *dev);
    215 +
    216 +/**
    217 + * swlib_free_all: run swlib_free on all devices in the chain
    218 + * @dev: switch device struct
    219 + */
    220 +void swlib_free_all(struct switch_dev *dev);
    221 +
    222 +/**
    223 + * swlib_scan: probe the switch driver for available commands/attributes
    224 + * @dev: switch device struct
    225 + */
    226 +int swlib_scan(struct switch_dev *dev);
    227 +
    228 +/**
    229 + * swlib_lookup_attr: look up a switch attribute
    230 + * @dev: switch device struct
    231 + * @type: global, port or vlan
    232 + * @name: name of the attribute
    233 + */
    234 +struct switch_attr *swlib_lookup_attr(struct switch_dev *dev,
    235 +               enum swlib_attr_group atype, const char *name);
    236 +
    237 +/**
    238 + * swlib_set_attr: set the value for an attribute
    239 + * @dev: switch device struct
    240 + * @attr: switch attribute struct
    241 + * @val: attribute value pointer
    242 + * returns 0 on success
    243 + */
    244 +int swlib_set_attr(struct switch_dev *dev, struct switch_attr *attr,
    245 +               struct switch_val *val);
    246 +
    247 +/**
    248 + * swlib_set_attr_string: set the value for an attribute with type conversion
    249 + * @dev: switch device struct
    250 + * @attr: switch attribute struct
    251 + * @port_vlan: port or vlan (if applicable)
    252 + * @str: string value
    253 + * returns 0 on success
    254 + */
    255 +int swlib_set_attr_string(struct switch_dev *dev, struct switch_attr *attr,
    256 +               int port_vlan, const char *str);
    257 +
    258 +/**
    259 + * swlib_get_attr: get the value for an attribute
    260 + * @dev: switch device struct
    261 + * @attr: switch attribute struct
    262 + * @val: attribute value pointer
    263 + * returns 0 on success
    264 + * for string attributes, the result string must be freed by the caller
    265 + */
    266 +int swlib_get_attr(struct switch_dev *dev, struct switch_attr *attr,
    267 +               struct switch_val *val);
    268 +
    269 +/**
    270 + * swlib_apply_from_uci: set up the switch from a uci configuration
    271 + * @dev: switch device struct
    272 + * @p: uci package which contains the desired global config
    273 + */
    274 +int swlib_apply_from_uci(struct switch_dev *dev, struct uci_package *p);
    275 +
    276 +#endif
  • trunk/debian/packages/swconfig/trunk/debian/patches/011_use_openwrt_version_for_so

    r810 r819  
    11Author: Johan van Zoomeren <amain@debwrt.net>
    22
     3Index: swconfig-0.0.10/src/Makefile
     4===================================================================
    35--- swconfig-0.0.10.orig/src/Makefile
    46+++ swconfig-0.0.10/src/Makefile
Note: See TracChangeset for help on using the changeset viewer.