+// ----------------------------------------------------------------------------------------------
+int ngadmin_setVLANDotConf (struct ngadmin *nga, unsigned short vlan, const unsigned char *ports) {
+
+ List *attr;
+ struct swi_attr *sa;
+ int i;
+ char *p;
+
+
+ if ( nga==NULL || ports==NULL || vlan<1 || vlan>VLAN_MAX ) {
+ return ERR_INVARG;
+ } else if ( (sa=nga->current)==NULL ) {
+ return ERR_NOTLOG;
+ }
+
+
+
+ attr=createEmptyList();
+ p=malloc(4);
+ *(unsigned short*)p=htons(vlan);
+
+ for (i=1; i<=sa->ports; ++i) {
+ if ( ports[i-1]==VLAN_TAGGED ) { // tagged
+ p[3]|=(1<<(sa->ports-i));
+ } else if ( ports[i-1]==VLAN_UNTAGGED ) { // untagged
+ p[2]|=(1<<(sa->ports-i));
+ }
+ }
+
+ // tagged ports must be also present in untagged ports
+ p[2]|=ports[3];
+
+
+ pushBackList(attr, newAttr(ATTR_VLAN_DOT_CONF, 4, p));
+
+
+ return writeRequest(nga, attr);
+
+}
+
+
+
+// ---------------------------------------------------------------
+int ngadmin_VLANDestroy (struct ngadmin *nga, unsigned short vlan) {
+
+ List *attr;
+ struct swi_attr *sa;
+
+
+ if ( nga==NULL || vlan<1 || vlan>VLAN_MAX ) {
+ return ERR_INVARG;
+ } else if ( (sa=nga->current)==NULL ) {
+ return ERR_NOTLOG;
+ }
+
+
+ attr=createEmptyList();
+ pushBackList(attr, newShortAttr(ATTR_VLAN_DESTROY, vlan));
+
+
+ return writeRequest(nga, attr);
+
+}
+
+
+
+// ----------------------------------------------------------------
+int ngadmin_getAllPVID (struct ngadmin *nga, unsigned short *ports) {