4 * All client applications which want to use NgAdmin must include this file.
14 #include <arpa/inet.h>
16 #include <netinet/ether.h>
20 #define EXPORT __attribute__((visibility("default")))
28 * Maximum size of product string.
30 #define PRODUCT_SIZE 64
33 * Maximum size of name string.
38 * Maximum size of firmware version string.
40 #define FIRMWARE_SIZE 64
46 * This enum lists all the error codes the library can return to user.
49 ERR_OK = 0, /**< no error */
50 ERR_NET = -1, /**< network error */
51 ERR_NOTLOG = -2, /**< not logged */
52 ERR_DENIED = -3, /**< access denied */
53 ERR_BADPASS = -4, /**< bad password */
54 ERR_BADID = -5, /**< bad switch id */
55 ERR_INVARG = -6, /**< invalid argument */
56 ERR_TIMEOUT = -7, /**< timeout */
57 ERR_MEM = -8, /**< out of memory */
58 ERR_NOTIMPL = -9 /**< not implemented */
65 * This enum lists all the speeds a port can have.
68 SPEED_UNK = -1, /**< unknown status */
69 SPEED_DOWN = 0, /**< link down */
70 SPEED_10 = 1, /**< 10 Mb/s */
71 SPEED_100 = 4, /**< 100 Mb/s */
72 SPEED_1000 = 5 /**< 1000 Mb/s */
79 * This enum lists all the VLAN types available
82 VLAN_DISABLED = 0, /**< VLAN disabled */
83 VLAN_PORT_BASIC = 1, /**< port basic */
84 VLAN_PORT_ADV = 2, /**< port advanced */
85 VLAN_DOT_BASIC = 3, /**< 802.1q basic */
86 VLAN_DOT_ADV = 4 /**< 802.1q advanced */
91 * VLAN port specification.
92 * This enum lists all the VLAN specifications a port can have.
95 VLAN_UNSPEC = 0xFF, /**< unspecified */
96 VLAN_NO = 0, /**< not present */
97 VLAN_UNTAGGED = 1, /**< present, untagged */
98 VLAN_TAGGED = 2 /**< present, tagged */
111 #define VLAN_MAX 4093
117 * This enum lists all the availables QoS modes.
120 QOS_PORT = 1, /**< port based */
121 QOS_DOT = 2 /**< 802.1p based */
127 * This enum lists all the priorities a port can have.
130 PRIO_UNSPEC = -1, /**< unspecified */
131 PRIO_HIGH = 1, /**< high */
132 PRIO_MED = 2, /**< medium */
133 PRIO_NORM = 3, /**< normal */
134 PRIO_LOW = 4 /**< low */
142 * This enum lists all the available bitrates.
145 BITRATE_UNSPEC = -1, /**< unspecified */
146 BITRATE_NOLIMIT = 0, /**< unlimited */
147 BITRATE_512K = 1, /**< 512 Kb/s */
148 BITRATE_1M = 2, /**< 1 Mb/s */
149 BITRATE_2M = 3, /**< 2 Mb/s */
150 BITRATE_4M = 4, /**< 4 Mb/s */
151 BITRATE_8M = 5, /**< 8 Mb/s */
152 BITRATE_16M = 6, /**< 16 Mb/s */
153 BITRATE_32M = 7, /**< 32 Mb/s */
154 BITRATE_64M = 8, /**< 64 Mb/s */
155 BITRATE_128M = 9, /**< 128 Mb/s */
156 BITRATE_256M = 10, /**< 256 Mb/s */
157 BITRATE_512M = 11 /**< 512 Mb/s */
164 * NgAdmin library main structure.
165 * The structure content is hidden to clients to prevent them to manually
166 * change data and mess up things.
173 * Network configuration.
174 * Represents the network configuration of a switch.
177 struct in_addr ip; /**< IP */
178 struct in_addr netmask; /**< netmask */
179 struct in_addr gw; /**< gateway IP */
180 bool dhcp; /**< DHCP enabled */
185 * Switch characteristics.
186 * Represents the main characteristics of a switch.
189 char product[PRODUCT_SIZE]; /**< product name (eg.\ GS108EV1) */
190 char name[NAME_SIZE]; /**< custom name */
191 char firmware[FIRMWARE_SIZE]; /**< firmware version string */
192 unsigned char ports; /**< number of ports */
193 struct ether_addr mac; /**< MAC address */
194 struct net_conf nc; /**< network configuration */
200 * Represents statistics of a particular port.
203 unsigned long long recv; /**< packets received */
204 unsigned long long sent; /**< packets sent */
205 unsigned long long crc; /**< CRC errors */
210 * IGMP snooping configuration.
211 * Represents the IGMP snooping configuration of a switch.
214 bool enable; /**< IGMP snooping enabled */
215 unsigned short vlan; /**< VLAN on which IGMP snooping is done */
216 bool validate; /**< validate IGMPv3 headers */
217 bool block; /**< block unknown multicast addresses */
225 char port; /**< port */
226 int v1; /**< raw value 1 */
227 int v2; /**< raw value 2 */
238 * Initialize NgAdmin library.
239 * This function initializes the NgAdmin library. You must call it before any
241 * @param iface The network interface to use.
242 * @return A pointer to a ngadmin structure, or NULL if an error occurred.
244 struct ngadmin* ngadmin_init (const char *iface) EXPORT;
248 * Close NgAdmin library.
249 * This function frees the resources used by the library. You really should
250 * call this when you are done using the library.
251 * @param nga A pointer to the ngadmin structure.
252 * @return ERR_OK when everything is well or an error code otherwise.
254 int ngadmin_close (struct ngadmin *nga) EXPORT;
258 * Force the use of the interface.
259 * This function allows to solve two problems:
260 * - When you have multiple network interfaces, sending to the global broadcast
261 * address may not send the packet on the interface you want. \n
262 * This function forces the packet to go on the interface you specified at
263 * the library initialization.
264 * - When the switch is not in your network range, because DHCP is disabled or
265 * you started the DHCP server after the switch. \n
266 * This function allows you to ignore the routing table and consider every
267 * address is directly reachable on the interface. \n
268 * An alternative is to use ngadmin_setKeepBroadcasting, or simply add a route.
270 * @warning Requires root priviledges.
271 * @see ngadmin_setKeepBroadcasting()
272 * @param nga A pointer to the ngadmin structure.
273 * @return ERR_OK when everything is well or an error code otherwise.
275 int ngadmin_forceInterface (struct ngadmin *nga) EXPORT;
279 * Keep broadcasting even when talking with a particular switch.
280 * By default, once you login on a switch, NgAdmin talks with it using unicast.
281 * This prevents the password from being sent to all your network. \n
282 * The switch still replies using broadcast, but the password is not included
284 * This function allows you to disable this feature and do like the official
285 * Windows application that always use broadcast packets. \n
286 * This also allows to configure a switch which is not on your network range
287 * without forcing the interface. \n
288 * When you enable this option, you must be aware that on every parameter
289 * change you make on the switch, your password is broadcasted in cleartext
290 * to all your network.
291 * @see ngadmin_forceInterface()
292 * @param nga A pointer to the ngadmin structure.
293 * @param value Enable or disable the systematic use of broadcast packets.
294 * @return ERR_OK when everything is well or an error code otherwise.
296 int ngadmin_setKeepBroadcasting (struct ngadmin *nga, bool value) EXPORT;
300 * Use global broadcast address.
301 * By default, NgAdmin uses the interface broadcast address.
302 * This option forces the lib to use the global broadcast address
303 * (255.255.255.255) instead.
304 * @warning If you have multiple interfaces, enabling this may cause problems.
305 * @see ngadmin_forceInterface()
306 * @param nga A pointer to the ngadmin structure.
307 * @param value Enable or disable the use of the global broadcast address.
308 * @return ERR_OK when everything is well or an error code otherwise.
310 int ngadmin_useGlobalBroadcast (struct ngadmin *nga, bool value) EXPORT;
314 * Specify the password to use to login.
315 * Sets the password to use to login on switches.
316 * @param nga A pointer to the ngadmin structure.
317 * @param pass The password string to use.
318 * @return ERR_OK when everything is well or an error code otherwise.
320 int ngadmin_setPassword (struct ngadmin *nga, const char *pass) EXPORT;
324 * Set timeout for networking.
325 * Sets the timeout when waiting for network packets.
326 * @param nga A pointer to the ngadmin structure.
327 * @param tv A pointer to a timeval structure.
328 * @return ERR_OK when everything is well or an error code otherwise.
330 int ngadmin_setTimeout (struct ngadmin *nga, const struct timeval *tv) EXPORT;
334 * Scan the network for switches.
335 * This function scans the network for Netgear switches that use NSDP.
336 * @warning Systematically blocks for the timeout value.
337 * @note If you are logged on a switch, calling this function will delog you.
338 * @param nga A pointer to the ngadmin structure.
339 * @return ERR_OK when everything is well or an error code otherwise.
341 int ngadmin_scan (struct ngadmin *nga) EXPORT;
345 * Get the list of detected switches.
346 * This function allows you gou get the list of all last detected switchs.
347 * @note When a scan is done, this array is no more valid.
348 * @param nga A pointer to the ngadmin structure.
349 * @param nb A pointer to an integer which will receive the number of switches.
350 * @return A pointer to an array of switch characteristics.
352 const struct swi_attr* ngadmin_getSwitchTab (struct ngadmin *nga, int *nb) EXPORT;
356 * Get the switch on which you are logged.
357 * This function allows you to get the switch on which you are logged.
358 * @param nga A pointer to the ngadmin structure.
359 * @return A pointer the switch characteristics or NULL if you are not logged.
361 const struct swi_attr* ngadmin_getCurrentSwitch (struct ngadmin *nga) EXPORT;
366 * Upgrade the switch firmware.
367 * This function allows you to upgrade the switch firmware.
368 * @warning Currently not implemented.
369 * @note You must be logged on a switch.
370 * @param nga A pointer to the ngadmin structure.
371 * @param filename A path to the file of the new firmware to send.
372 * @return ERR_NOTIMPL
374 int ngadmin_upgradeFirmware (struct ngadmin *nga, const char *filename) EXPORT;
379 * This function permits to login on a switch.
380 * @note If you are already logged, this function delogs you whatever the new
381 * login attempt is successfull or not.
382 * @see ngadmin_setPassword()
383 * @param nga A pointer to the ngadmin structure.
384 * @param id The id (position in the switch array) of the switch you want to login to.
385 * @return ERR_OK when everything is well or an error code otherwise.
387 int ngadmin_login (struct ngadmin *nga, int id) EXPORT;
391 * Get the ports speed status.
392 * This functions retrieves the ports speed status.
393 * @note You must be logged on a switch.
394 * @param nga A pointer to the ngadmin structure.
395 * @param ports A pointer to an array of ports which will receive ports status.
396 * Must not be NULL. The array size must be ports_count*sizeof(unsigned char).
397 * @return ERR_OK when everything is well or an error code otherwise.
399 int ngadmin_getPortsStatus (struct ngadmin *nga, unsigned char *ports) EXPORT;
403 * Change the name of a switch.
404 * This changes the name of a switch.
405 * @note You must be logged on a switch.
406 * @param nga A pointer to the ngadmin structure.
407 * @param name The name string to use. A NULL value clears the name.
408 * @return ERR_OK when everything is well or an error code otherwise.
410 int ngadmin_setName (struct ngadmin *nga, const char *name) EXPORT;
414 * Get the ports statistics.
415 * Retrieves the ports packet statistics.
416 * @note You must be logged on a switch.
417 * @param nga A pointer to the ngadmin structure.
418 * @param ps A pointer to an array of port_stats structures. Must not be NULL.
419 * The array size must be ports_count*sizeof(struct port_stats).
420 * @return ERR_OK when everything is well or an error code otherwise.
422 int ngadmin_getPortsStatistics (struct ngadmin *nga, struct port_stats *ps) EXPORT;
426 * Reset the ports statistics.
427 * This resets the ports packet statistics.
428 * @note You must be logged on a switch.
429 * @param nga A pointer to the ngadmin structure.
430 * @return ERR_OK when everything is well or an error code otherwise.
432 int ngadmin_resetPortsStatistics (struct ngadmin *nga) EXPORT;
436 * Change the password of a switch.
437 * This changes the password of a switch. On success, automatically updates
438 * local password so you do not have to relog.
439 * @note You must be logged on a switch.
440 * @param nga A pointer to the ngadmin structure.
441 * @param pass The new password string to use.
442 * @return ERR_OK when everything is well or an error code otherwise.
444 int ngadmin_changePassword (struct ngadmin *nga, const char* pass) EXPORT;
448 * Get the broadcast storm filtering state.
449 * Retrieves the broadcast storm filtering state.
450 * @note You must be logged on a switch.
451 * @param nga A pointer to the ngadmin structure.
452 * @param s A pointer to an integer which will receive 0 or 1.
453 * @return ERR_OK when everything is well or an error code otherwise.
455 int ngadmin_getStormFilterState (struct ngadmin *nga, int *s) EXPORT;
459 * Set the broadcast storm filtering state.
460 * Changes the broadcast storm filtering state.
461 * @note You must be logged on a switch.
462 * @param nga A pointer to the ngadmin structure.
463 * @param s An integer with value 0 or 1.
464 * @return ERR_OK when everything is well or an error code otherwise.
466 int ngadmin_setStormFilterState (struct ngadmin *nga, int s) EXPORT;
470 * Get the broadcast storm bitrates.
471 * Retrieves the broadcast storm filtering bitrates.
472 * @note You must be logged on a switch.
473 * @param nga A pointer to the ngadmin structure.
474 * @param ports A pointer to an array of integers. Must not be NULL.
475 * The array size must be ports_count*sizeof(int).
476 * @return ERR_OK when everything is well or an error code otherwise.
478 int ngadmin_getStormFilterValues (struct ngadmin *nga, int *ports) EXPORT;
482 * Set the broadcast storm bitrates.
483 * Changes the broadcast storm filtering values.
484 * @note You must be logged on a switch.
485 * @param nga A pointer to the ngadmin structure.
486 * @param ports A pointer to an array of integers. Must not be NULL.
487 * The array size must be ports_count*sizeof(int).
488 * @return ERR_OK when everything is well or an error code otherwise.
490 int ngadmin_setStormFilterValues (struct ngadmin *nga, const int *ports) EXPORT;
494 * Get the bitrates limits.
495 * Retrieves the bitrates limits of each port.
496 * @note You must be logged on a switch.
497 * @param nga A pointer to the ngadmin structure.
498 * @param ports A pointer to an array of integers. Must not be NULL.
499 * The array size must be ports_count*sizeof(int).
500 * @return ERR_OK when everything is well or an error code otherwise.
502 int ngadmin_getBitrateLimits (struct ngadmin *nga, int *ports) EXPORT;
506 * Set the bitrates limits.
507 * Changes the bitrates limits of each port.
508 * @note You must be logged on a switch.
509 * @param nga A pointer to the ngadmin structure.
510 * @param ports A pointer to an array of integers. Must not be NULL.
511 * The array size must be ports_count*sizeof(int).
512 * @return ERR_OK when everything is well or an error code otherwise.
514 int ngadmin_setBitrateLimits (struct ngadmin *nga, const int *ports) EXPORT;
519 * Retrieves the QoS mode.
520 * @note You must be logged on a switch.
521 * @param nga A pointer to the ngadmin structure.
522 * @param s A pointer to an integer. Must not be NULL.
523 * @return ERR_OK when everything is well or an error code otherwise.
525 int ngadmin_getQOSMode (struct ngadmin *nga, int *s) EXPORT;
530 * Changes the QoS mode.
531 * @note You must be logged on a switch.
532 * @param nga A pointer to the ngadmin structure.
533 * @param s An integer with the new mode.
534 * @return ERR_OK when everything is well or an error code otherwise.
536 int ngadmin_setQOSMode (struct ngadmin *nga, int s) EXPORT;
540 * Get the QoS values.
541 * Retrieves the QoS priority values for all the ports.
542 * @note You must be logged on a switch.
543 * @note The switch QoS mode should be port based to use this function.
544 * @param nga A pointer to the ngadmin structure.
545 * @param ports A pointer to an array of chars. Must not be NULL.
546 The array size must be ports_count*sizeof(ports).
547 * @return ERR_OK when everything is well or an error code otherwise.
549 int ngadmin_getQOSValues (struct ngadmin *nga, char *ports) EXPORT;
553 * Set the QoS values.
554 * Changes the QoS priority values for all the ports.
555 * @note You must be logged on a switch.
556 * @note The switch QoS mode should be port based to use this function.
557 * @param nga A pointer to the ngadmin structure.
558 * @param ports A pointer to an array of chars. Must not be NULL.
559 The array size must be ports_count*sizeof(ports).
560 * @return ERR_OK when everything is well or an error code otherwise.
562 int ngadmin_setQOSValues (struct ngadmin *nga, const char *ports) EXPORT;
566 * Restart the switch.
567 * Restarts the switch.
568 * @note You must be logged on a switch.
569 * @note If successfull, you should wait a few seconds while the switch
570 effectively restarts.
571 * @param nga A pointer to the ngadmin structure.
572 * @return ERR_OK when everything is well or an error code otherwise.
574 int ngadmin_restart (struct ngadmin *nga) EXPORT;
578 * Restore the switch default parameters.
579 * Restores the switch default parameters and restarts it.
580 * @note You must be logged on a switch.
581 * @note If successfull, you will be delogged and the switch list will be
582 cleared. You should wait a few seconds while the switch effectively restarts.
583 * @param nga A pointer to the ngadmin structure.
584 * @return ERR_OK when everything is well or an error code otherwise.
586 int ngadmin_defaults (struct ngadmin *nga) EXPORT;
590 * Get the port mirroring values.
591 * Retrieves the port mirrorring values.
592 * @note The switch QoS mode should be port based to use this function.
593 * @note You must be logged on a switch.
594 * @param nga A pointer to the ngadmin structure.
595 * @param ports A pointer to an array of chars. Must not be NULL. \n
596 The first element of the array is the output port (or 0 if port
597 mirroring is disabled), followed by 0 or 1 values for each port
598 if it is present or not. \n
599 The array size must be (1+ports_count)*sizeof(char).
600 * @return ERR_OK when everything is well or an error code otherwise.
602 int ngadmin_getMirror (struct ngadmin *nga, char *ports) EXPORT;
606 * Set the port mirroring values.
607 * Changes the port mirroring values.
608 * @note The switch QoS mode should be port based to use this function.
609 * @param nga A pointer to the ngadmin structure.
610 * @param ports A pointer to an array of chars. It as the same format as in
611 ngadmin_getMirror. \n
612 If it is NULL, port mirroring is disabled.
613 * @return ERR_OK when everything is well or an error code otherwise.
615 int ngadmin_setMirror (struct ngadmin *nga, const char *ports) EXPORT;
619 * Get the IGMP configuration.
620 * Retrieves the IGMP & multicast configuration.
621 * @note You must be logged on a switch.
622 * @param nga A pointer to the ngadmin structure.
623 * @param ic A pointer to an igmp_conf structure. Must not be NULL.
624 * @return ERR_OK when everything is well or an error code otherwise.
626 int ngadmin_getIGMPConf (struct ngadmin *nga, struct igmp_conf *ic) EXPORT;
630 * Set the IGMP configuration.
631 * Changes the IGMP configuration.
632 * @note You must be logged on a switch.
633 * @param nga A pointer to the ngadmin structure.
634 * @param ic A pointer to an igmp_conf structure. Must not be NULL.
635 * @return ERR_OK when everything is well or an error code otherwise.
637 int ngadmin_setIGMPConf (struct ngadmin *nga, const struct igmp_conf *ic) EXPORT;
641 * Perform a cable test.
642 * Performs a cable test on one ore more ports.
643 * @note Results are still raw values.
644 * @note This function takes a very long time.
645 * @note You must be logged on a switch.
646 * @param nga A pointer to the ngadmin structure.
647 * @param ct A pointer to an array of cabletest structures. Must not be NULL.
648 * @param nb The number of elements in the array.
649 * @return ERR_OK when everything is well or an error code otherwise.
651 int ngadmin_cabletest (struct ngadmin *nga, struct cabletest *ct, int nb) EXPORT;
655 * Set the network configuration.
656 * Changes the network configuration.
657 * @note You must be logged on a switch.
658 * @param nga A pointer to the ngadmin structure.
659 * @param nc A pointer to a net_conf structure. Must not be NULL. \n
660 Only non-zero fields of the structure are taken into account.
661 * @return ERR_OK when everything is well or an error code otherwise.
663 int ngadmin_setNetConf (struct ngadmin *nga, const struct net_conf *nc) EXPORT;
668 * Retrieves the VLAN type.
669 * @note You must be logged on a switch.
670 * @param nga A pointer to the ngadmin structure.
671 * @param t A pointer to an integer which will receive the VLAN type. Must not be NULL.
672 * @return ERR_OK when everything is well or an error code otherwise.
674 int ngadmin_getVLANType (struct ngadmin *nga, int *t) EXPORT;
679 * Changes the VLAN type.
680 * @note You must be logged on a switch.
681 * @param nga A pointer to the ngadmin structure.
682 * @param t An integer which contains the new VLAN type.
683 * @return ERR_OK when everything is well or an error code otherwise.
685 int ngadmin_setVLANType (struct ngadmin *nga, int t) EXPORT;
689 * Get all the 802.1q VLAN configuration.
690 * Retrieves all the VLAN configuration in 802.1q mode.
691 * @note The switch should be in 802.1q mode.
692 * @note You must be logged on a switch.
693 * @param nga A pointer to the ngadmin structure.
694 * @param vlans A pointer to an array of unsigned shorts which will receive
695 * VLAN ids. Must not be NULL. \n
696 * The array size must be sizeof(unsigned short)*(*nb).
697 * @param ports A pointer to an array of unsigned chars which will receive the
698 802.1q configuration for each VLAN. Must not be NULL. \n
699 The array size must be sizeof(unsigned char)*ports_count*(*nb).
700 * @param nb A pointer to an integer which contains the maximum number of
701 elements allowed in the array. Must not be NULL. \n
702 It will receive the actual number of VLAN written in the arrays.
703 * @return ERR_OK when everything is well or an error code otherwise.
705 int ngadmin_getVLANDotAllConf (struct ngadmin *nga, unsigned short *vlans, unsigned char *ports, int *nb) EXPORT;
709 * Get the configuration of a VLAN in 802.1q mode.
710 * Retrieves the configuration of a particular VLAN in 802.1q mode.
711 * @note The switch should be in 802.1q mode.
712 * @note You must be logged on a switch.
713 * @param nga A pointer to the ngadmin structure.
714 * @param vlan The VLAN you want to get the configuration.
715 * @param ports A pointer to an array of integers which will receive the
716 configuration. Must not be NULL.
717 * @return ERR_OK when everything is well or an error code otherwise.
719 int ngadmin_getVLANDotConf (struct ngadmin *nga, unsigned short vlan, unsigned char *ports) EXPORT;
723 * Set the configuration if a VLAN in 802.1q mode.
724 * Changes the configuration of a particular VLAN in 802.1q mode.
725 * @note The switch should be in 802.1q mode.
726 * @note You must be logged on a switch.
727 * @param nga A pointer to the ngadmin structure.
728 * @param vlan The VLAN you want to change the configuration.
729 * @param ports A pointer to an array of integers which contain the
730 configuration. Must not be NULL.
731 * @return ERR_OK when everything is well or an error code otherwise.
733 int ngadmin_setVLANDotConf (struct ngadmin *nga, unsigned short vlan, const unsigned char *ports) EXPORT;
737 * Destroy a VLAN in 802.1q mode.
738 * Destroys a particular VLAN in 802.1q mode.
739 * @note The switch should be in 802.1q mode.
740 * @note You must be logged on a switch.
741 * @param nga A pointer to the ngadmin structure.
742 * @param vlan The VLAN you want to destroy.
743 * @return ERR_OK when everything is well or an error code otherwise.
745 int ngadmin_VLANDestroy (struct ngadmin *nga, unsigned short vlan) EXPORT;
749 * Get the PVID values.
750 * Retrieves the PVID values of all the ports.
751 * @note You must be logged on a switch.
752 * @param nga A pointer to the ngadmin structure.
753 * @param ports A pointer to an array of unsigned shorts which will receive the
754 * PVID values. Must not be NULL. \n
755 * The array size must be sizeof(unsigned short)*ports_count.
756 * @return ERR_OK when everything is well or an error code otherwise.
758 int ngadmin_getAllPVID (struct ngadmin *nga, unsigned short *ports) EXPORT;
762 * Set the PVID of one port.
763 * Changes the PVID of one port.
764 * @note You must be logged on a switch.
765 * @param nga A pointer to the ngadmin structure.
766 * @param port The port you want to change PVID.
767 * @param vlan The new PVID value.
768 * @return ERR_OK when everything is well or an error code otherwise.
770 int ngadmin_setPVID (struct ngadmin *nga, unsigned char port, unsigned short vlan) EXPORT;