diff options
author | Felix Fietkau <nbd@openwrt.org> | 2009-04-21 01:35:30 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2009-04-21 01:35:30 +0000 |
commit | 1a7b537ebbad637e5a8b75aa7b3b7207fe26fb92 (patch) | |
tree | cd0e54c4973624321c9d584a9d64885df936b58a /package/swconfig/src/swlib.h | |
parent | 3c7b1324a5f77c0bede093dc9c8b5de9c270dc58 (diff) | |
download | upstream-1a7b537ebbad637e5a8b75aa7b3b7207fe26fb92.tar.gz upstream-1a7b537ebbad637e5a8b75aa7b3b7207fe26fb92.tar.bz2 upstream-1a7b537ebbad637e5a8b75aa7b3b7207fe26fb92.zip |
swconfig: implement uci loading support
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@15315 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/swconfig/src/swlib.h')
-rw-r--r-- | package/swconfig/src/swlib.h | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/package/swconfig/src/swlib.h b/package/swconfig/src/swlib.h index e00ff47a51..b3c6769de1 100644 --- a/package/swconfig/src/swlib.h +++ b/package/swconfig/src/swlib.h @@ -1,7 +1,7 @@ /* * swlib.h: Switch configuration API (user space part) * - * Copyright (C) 2008 Felix Fietkau <nbd@openwrt.org> + * Copyright (C) 2008-2009 Felix Fietkau <nbd@openwrt.org> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -110,6 +110,7 @@ struct switch_dev; struct switch_attr; struct switch_port; struct switch_val; +struct uci_package; struct switch_dev { int id; @@ -200,6 +201,17 @@ int swlib_set_attr(struct switch_dev *dev, struct switch_attr *attr, struct switch_val *val); /** + * swlib_set_attr_string: set the value for an attribute with type conversion + * @dev: switch device struct + * @attr: switch attribute struct + * @port_vlan: port or vlan (if applicable) + * @str: string value + * returns 0 on success + */ +int swlib_set_attr_string(struct switch_dev *dev, struct switch_attr *attr, + int port_vlan, const char *str); + +/** * swlib_get_attr: get the value for an attribute * @dev: switch device struct * @attr: switch attribute struct @@ -210,4 +222,11 @@ int swlib_set_attr(struct switch_dev *dev, struct switch_attr *attr, int swlib_get_attr(struct switch_dev *dev, struct switch_attr *attr, struct switch_val *val); +/** + * swlib_apply_from_uci: set up the switch from a uci configuration + * @dev: switch device struct + * @p: uci package which contains the desired global config + */ +int swlib_apply_from_uci(struct switch_dev *dev, struct uci_package *p); + #endif |