4 * All client applications which want to use NgAdmin must include this file.
14 #include <arpa/inet.h>
16 #include <netinet/ether.h>
21 * Maximum size of product string.
23 #define PRODUCT_SIZE 64
26 * Maximum size of name string.
31 * Maximum size of firmware version string.
33 #define FIRMWARE_SIZE 64
39 * This enum lists all the error codes the library can return to user.
42 ERR_OK = 0, /**< no error */
43 ERR_NET = -1, /**< network error */
44 ERR_NOTLOG = -2, /**< not logged */
45 ERR_DENIED = -3, /**< access denied */
46 ERR_BADPASS = -4, /**< bad password */
47 ERR_BADID = -5, /**< bad switch id */
48 ERR_INVARG = -6, /**< invalid argument */
49 ERR_TIMEOUT = -7, /**< timeout */
50 ERR_MEM = -8, /**< out of memory */
51 ERR_NOTIMPL = -9 /**< not implemented */
58 * This enum lists all the speeds a port can have.
61 SPEED_UNK = -1, /**< unknown status */
62 SPEED_DOWN = 0, /**< link down */
63 SPEED_10 = 1, /**< 10 Mb/s */
64 SPEED_100 = 4, /**< 100 Mb/s */
65 SPEED_1000 = 5 /**< 1000 Mb/s */
72 * This enum lists all the VLAN types available
75 VLAN_DISABLED = 0, /**< VLAN disabled */
76 VLAN_PORT_BASIC = 1, /**< port basic */
77 VLAN_PORT_ADV = 2, /**< port advanced */
78 VLAN_DOT_BASIC = 3, /**< 802.1q basic */
79 VLAN_DOT_ADV = 4 /**< 802.1q advanced */
84 * VLAN port specification.
85 * This enum lists all the VLAN specifications a port can have.
88 VLAN_UNSPEC = 0xFF, /**< unspecified */
89 VLAN_NO = 0, /**< not present */
90 VLAN_UNTAGGED = 1, /**< present, untagged */
91 VLAN_TAGGED = 2 /**< present, tagged */
102 * Maximum 802.1q VLAN id.
104 #define VLAN_DOT_MAX 4093
107 * Maximum port VLAN id.
109 #define VLAN_PORT_MAX 9
114 * This enum lists all the availables QoS modes.
117 QOS_PORT = 1, /**< port based */
118 QOS_DOT = 2 /**< 802.1p based */
124 * This enum lists all the priorities a port can have.
127 PRIO_UNSPEC = -1, /**< unspecified */
128 PRIO_HIGH = 1, /**< high */
129 PRIO_MED = 2, /**< medium */
130 PRIO_NORM = 3, /**< normal */
131 PRIO_LOW = 4 /**< low */
139 * This enum lists all the available bitrates.
142 BITRATE_UNSPEC = -1, /**< unspecified */
143 BITRATE_NOLIMIT = 0, /**< unlimited */
144 BITRATE_512K = 1, /**< 512 Kb/s */
145 BITRATE_1M = 2, /**< 1 Mb/s */
146 BITRATE_2M = 3, /**< 2 Mb/s */
147 BITRATE_4M = 4, /**< 4 Mb/s */
148 BITRATE_8M = 5, /**< 8 Mb/s */
149 BITRATE_16M = 6, /**< 16 Mb/s */
150 BITRATE_32M = 7, /**< 32 Mb/s */
151 BITRATE_64M = 8, /**< 64 Mb/s */
152 BITRATE_128M = 9, /**< 128 Mb/s */
153 BITRATE_256M = 10, /**< 256 Mb/s */
154 BITRATE_512M = 11 /**< 512 Mb/s */
161 * NgAdmin library main structure.
162 * The structure content is hidden to clients to prevent them to manually
163 * change data and mess up things.
170 * Network configuration.
171 * Represents the network configuration of a switch.
174 struct in_addr ip; /**< IP */
175 struct in_addr netmask; /**< netmask */
176 struct in_addr gw; /**< gateway IP */
177 bool dhcp; /**< DHCP enabled */
182 * Switch characteristics.
183 * Represents the main characteristics of a switch.
186 char product[PRODUCT_SIZE]; /**< product name (eg.\ GS108EV1) */
187 char name[NAME_SIZE]; /**< custom name */
188 char firmware[FIRMWARE_SIZE]; /**< firmware version string */
189 unsigned char ports; /**< number of ports */
190 struct ether_addr mac; /**< MAC address */
191 struct net_conf nc; /**< network configuration */
197 * Represents statistics of a particular port.
200 unsigned long long recv; /**< packets received */
201 unsigned long long sent; /**< packets sent */
202 unsigned long long crc; /**< CRC errors */
207 * IGMP snooping configuration.
208 * Represents the IGMP snooping configuration of a switch.
211 bool enable; /**< IGMP snooping enabled */
212 unsigned short vlan; /**< VLAN on which IGMP snooping is done */
213 bool validate; /**< validate IGMPv3 headers */
214 bool block; /**< block unknown multicast addresses */
222 char port; /**< port */
223 int v1; /**< raw value 1 */
224 int v2; /**< raw value 2 */
235 * Initialize NgAdmin library.
236 * This function initializes the NgAdmin library. You must call it before any
238 * @param iface The network interface to use.
239 * @return A pointer to a ngadmin structure, or NULL if an error occurred.
241 struct ngadmin* ngadmin_init (const char *iface);
245 * Close NgAdmin library.
246 * This function frees the resources used by the library. You really should
247 * call this when you are done using the library.
248 * @param nga A pointer to the ngadmin structure.
249 * @return ERR_OK when everything is well or an error code otherwise.
251 int ngadmin_close (struct ngadmin *nga);
255 * Force the use of the interface.
256 * This function allows to solve two problems:
257 * - When you have multiple network interfaces, sending to the global broadcast
258 * address may not send the packet on the interface you want. \n
259 * This function forces the packet to go on the interface you specified at
260 * the library initialization.
261 * - When the switch is not in your network range, because DHCP is disabled or
262 * you started the DHCP server after the switch. \n
263 * This function allows you to ignore the routing table and consider every
264 * address is directly reachable on the interface. \n
265 * An alternative is to use ngadmin_setKeepBroadcasting, or simply add a route.
267 * @warning Requires root priviledges.
268 * @see ngadmin_setKeepBroadcasting()
269 * @param nga A pointer to the ngadmin structure.
270 * @return ERR_OK when everything is well or an error code otherwise.
272 int ngadmin_forceInterface (struct ngadmin *nga);
276 * Keep broadcasting even when talking with a particular switch.
277 * By default, once you login on a switch, NgAdmin talks with it using unicast.
278 * This prevents the password from being sent to all your network. \n
279 * The switch still replies using broadcast, but the password is not included
281 * This function allows you to disable this feature and do like the official
282 * Windows application that always use broadcast packets. \n
283 * This also allows to configure a switch which is not on your network range
284 * without forcing the interface. \n
285 * When you enable this option, you must be aware that on every parameter
286 * change you make on the switch, your password is broadcasted in cleartext
287 * to all your network.
288 * @see ngadmin_forceInterface()
289 * @param nga A pointer to the ngadmin structure.
290 * @param value Enable or disable the systematic use of broadcast packets.
291 * @return ERR_OK when everything is well or an error code otherwise.
293 int ngadmin_setKeepBroadcasting (struct ngadmin *nga, bool value);
297 * Use global broadcast address.
298 * By default, NgAdmin uses the interface broadcast address.
299 * This option forces the lib to use the global broadcast address
300 * (255.255.255.255) instead.
301 * @warning If you have multiple interfaces, enabling this may cause problems.
302 * @see ngadmin_forceInterface()
303 * @param nga A pointer to the ngadmin structure.
304 * @param value Enable or disable the use of the global broadcast address.
305 * @return ERR_OK when everything is well or an error code otherwise.
307 int ngadmin_useGlobalBroadcast (struct ngadmin *nga, bool value);
311 * Specify the password to use to login.
312 * Sets the password to use to login on switches.
313 * @param nga A pointer to the ngadmin structure.
314 * @param pass The password string to use.
315 * @return ERR_OK when everything is well or an error code otherwise.
317 int ngadmin_setPassword (struct ngadmin *nga, const char *pass);
321 * Set timeout for networking.
322 * Sets the timeout when waiting for network packets.
323 * @param nga A pointer to the ngadmin structure.
324 * @param tv A pointer to a timeval structure.
325 * @return ERR_OK when everything is well or an error code otherwise.
327 int ngadmin_setTimeout (struct ngadmin *nga, const struct timeval *tv);
331 * Scan the network for switches.
332 * This function scans the network for Netgear switches that use NSDP.
333 * @warning Systematically blocks for the timeout value.
334 * @note If you are logged on a switch, calling this function will delog you.
335 * @param nga A pointer to the ngadmin structure.
336 * @return ERR_OK when everything is well or an error code otherwise.
338 int ngadmin_scan (struct ngadmin *nga);
342 * Get the list of detected switches.
343 * This function allows you gou get the list of all last detected switchs.
344 * @note When a scan is done, this array is no more valid.
345 * @param nga A pointer to the ngadmin structure.
346 * @param nb A pointer to an integer which will receive the number of switches.
347 * @return A pointer to an array of switch characteristics.
349 const struct swi_attr* ngadmin_getSwitchTab (struct ngadmin *nga, int *nb);
353 * Get the switch on which you are logged.
354 * This function allows you to get the switch on which you are logged.
355 * @param nga A pointer to the ngadmin structure.
356 * @return A pointer the switch characteristics or NULL if you are not logged.
358 const struct swi_attr* ngadmin_getCurrentSwitch (struct ngadmin *nga);
363 * Upgrade the switch firmware.
364 * This function allows you to upgrade the switch firmware.
365 * @warning Currently not implemented.
366 * @note You must be logged on a switch.
367 * @param nga A pointer to the ngadmin structure.
368 * @param filename A path to the file of the new firmware to send.
369 * @return ERR_NOTIMPL
371 int ngadmin_upgradeFirmware (struct ngadmin *nga, const char *filename);
376 * This function permits to login on a switch.
377 * @note If you are already logged, this function delogs you whatever the new
378 * login attempt is successfull or not.
379 * @see ngadmin_setPassword()
380 * @param nga A pointer to the ngadmin structure.
381 * @param id The id (position in the switch array) of the switch you want to login to.
382 * @return ERR_OK when everything is well or an error code otherwise.
384 int ngadmin_login (struct ngadmin *nga, int id);
388 * Get the ports speed status.
389 * This functions retrieves the ports speed status.
390 * @note You must be logged on a switch.
391 * @param nga A pointer to the ngadmin structure.
392 * @param ports A pointer to an array of ports which will receive ports status.
393 * Must not be NULL. The array size must be ports_count*sizeof(unsigned char).
394 * @return ERR_OK when everything is well or an error code otherwise.
396 int ngadmin_getPortsStatus (struct ngadmin *nga, unsigned char *ports);
400 * Change the name of a switch.
401 * This changes the name of a switch.
402 * @note You must be logged on a switch.
403 * @param nga A pointer to the ngadmin structure.
404 * @param name The name string to use. A NULL value clears the name.
405 * @return ERR_OK when everything is well or an error code otherwise.
407 int ngadmin_setName (struct ngadmin *nga, const char *name);
411 * Get the ports statistics.
412 * Retrieves the ports packet statistics.
413 * @note You must be logged on a switch.
414 * @param nga A pointer to the ngadmin structure.
415 * @param ps A pointer to an array of port_stats structures. Must not be NULL.
416 * The array size must be ports_count*sizeof(struct port_stats).
417 * @return ERR_OK when everything is well or an error code otherwise.
419 int ngadmin_getPortsStatistics (struct ngadmin *nga, struct port_stats *ps);
423 * Reset the ports statistics.
424 * This resets the ports packet statistics.
425 * @note You must be logged on a switch.
426 * @param nga A pointer to the ngadmin structure.
427 * @return ERR_OK when everything is well or an error code otherwise.
429 int ngadmin_resetPortsStatistics (struct ngadmin *nga);
433 * Change the password of a switch.
434 * This changes the password of a switch. On success, automatically updates
435 * local password so you do not have to relog.
436 * @note You must be logged on a switch.
437 * @param nga A pointer to the ngadmin structure.
438 * @param pass The new password string to use.
439 * @return ERR_OK when everything is well or an error code otherwise.
441 int ngadmin_changePassword (struct ngadmin *nga, const char* pass);
445 * Get the broadcast storm filtering state.
446 * Retrieves the broadcast storm filtering state.
447 * @note You must be logged on a switch.
448 * @param nga A pointer to the ngadmin structure.
449 * @param s A pointer to an integer which will receive 0 or 1.
450 * @return ERR_OK when everything is well or an error code otherwise.
452 int ngadmin_getStormFilterState (struct ngadmin *nga, int *s);
456 * Set the broadcast storm filtering state.
457 * Changes the broadcast storm filtering state.
458 * @note You must be logged on a switch.
459 * @param nga A pointer to the ngadmin structure.
460 * @param s An integer with value 0 or 1.
461 * @return ERR_OK when everything is well or an error code otherwise.
463 int ngadmin_setStormFilterState (struct ngadmin *nga, int s);
467 * Get the broadcast storm bitrates.
468 * Retrieves the broadcast storm filtering bitrates.
469 * @note You must be logged on a switch.
470 * @param nga A pointer to the ngadmin structure.
471 * @param ports A pointer to an array of integers. Must not be NULL.
472 * The array size must be ports_count*sizeof(int).
473 * @return ERR_OK when everything is well or an error code otherwise.
475 int ngadmin_getStormFilterValues (struct ngadmin *nga, int *ports);
479 * Set the broadcast storm bitrates.
480 * Changes the broadcast storm filtering values.
481 * @note You must be logged on a switch.
482 * @param nga A pointer to the ngadmin structure.
483 * @param ports A pointer to an array of integers. Must not be NULL.
484 * The array size must be ports_count*sizeof(int).
485 * @return ERR_OK when everything is well or an error code otherwise.
487 int ngadmin_setStormFilterValues (struct ngadmin *nga, const int *ports);
491 * Get the bitrates limits.
492 * Retrieves the bitrates limits of each port.
493 * @note You must be logged on a switch.
494 * @param nga A pointer to the ngadmin structure.
495 * @param ports A pointer to an array of integers. Must not be NULL.
496 * The array size must be ports_count*sizeof(int).
497 * @return ERR_OK when everything is well or an error code otherwise.
499 int ngadmin_getBitrateLimits (struct ngadmin *nga, int *ports);
503 * Set the bitrates limits.
504 * Changes the bitrates limits of each port.
505 * @note You must be logged on a switch.
506 * @param nga A pointer to the ngadmin structure.
507 * @param ports A pointer to an array of integers. Must not be NULL.
508 * The array size must be ports_count*sizeof(int).
509 * @return ERR_OK when everything is well or an error code otherwise.
511 int ngadmin_setBitrateLimits (struct ngadmin *nga, const int *ports);
516 * Retrieves the QoS mode.
517 * @note You must be logged on a switch.
518 * @param nga A pointer to the ngadmin structure.
519 * @param s A pointer to an integer. Must not be NULL.
520 * @return ERR_OK when everything is well or an error code otherwise.
522 int ngadmin_getQOSMode (struct ngadmin *nga, int *s);
527 * Changes the QoS mode.
528 * @note You must be logged on a switch.
529 * @param nga A pointer to the ngadmin structure.
530 * @param s An integer with the new mode.
531 * @return ERR_OK when everything is well or an error code otherwise.
533 int ngadmin_setQOSMode (struct ngadmin *nga, int s);
537 * Get the QoS values.
538 * Retrieves the QoS priority values for all the ports.
539 * @note You must be logged on a switch.
540 * @note The switch QoS mode should be port based to use this function.
541 * @param nga A pointer to the ngadmin structure.
542 * @param ports A pointer to an array of chars. Must not be NULL.
543 The array size must be ports_count*sizeof(ports).
544 * @return ERR_OK when everything is well or an error code otherwise.
546 int ngadmin_getQOSValues (struct ngadmin *nga, char *ports);
550 * Set the QoS values.
551 * Changes the QoS priority values for all the ports.
552 * @note You must be logged on a switch.
553 * @note The switch QoS mode should be port based to use this function.
554 * @param nga A pointer to the ngadmin structure.
555 * @param ports A pointer to an array of chars. Must not be NULL.
556 The array size must be ports_count*sizeof(ports).
557 * @return ERR_OK when everything is well or an error code otherwise.
559 int ngadmin_setQOSValues (struct ngadmin *nga, const char *ports);
563 * Restart the switch.
564 * Restarts the switch.
565 * @note You must be logged on a switch.
566 * @note If successfull, you should wait a few seconds while the switch
567 effectively restarts.
568 * @param nga A pointer to the ngadmin structure.
569 * @return ERR_OK when everything is well or an error code otherwise.
571 int ngadmin_restart (struct ngadmin *nga);
575 * Restore the switch default parameters.
576 * Restores the switch default parameters and restarts it.
577 * @note You must be logged on a switch.
578 * @note If successfull, you will be delogged and the switch list will be
579 cleared. You should wait a few seconds while the switch effectively restarts.
580 * @param nga A pointer to the ngadmin structure.
581 * @return ERR_OK when everything is well or an error code otherwise.
583 int ngadmin_defaults (struct ngadmin *nga);
587 * Get the port mirroring values.
588 * Retrieves the port mirrorring values.
589 * @note The switch QoS mode should be port based to use this function.
590 * @note You must be logged on a switch.
591 * @param nga A pointer to the ngadmin structure.
592 * @param ports A pointer to an array of chars. Must not be NULL. \n
593 The first element of the array is the output port (or 0 if port
594 mirroring is disabled), followed by 0 or 1 values for each port
595 if it is present or not. \n
596 The array size must be (1+ports_count)*sizeof(char).
597 * @return ERR_OK when everything is well or an error code otherwise.
599 int ngadmin_getMirror (struct ngadmin *nga, char *ports);
603 * Set the port mirroring values.
604 * Changes the port mirroring values.
605 * @note The switch QoS mode should be port based to use this function.
606 * @param nga A pointer to the ngadmin structure.
607 * @param ports A pointer to an array of chars. It as the same format as in
608 ngadmin_getMirror. \n
609 If it is NULL, port mirroring is disabled.
610 * @return ERR_OK when everything is well or an error code otherwise.
612 int ngadmin_setMirror (struct ngadmin *nga, const char *ports);
616 * Get the IGMP configuration.
617 * Retrieves the IGMP & multicast configuration.
618 * @note You must be logged on a switch.
619 * @param nga A pointer to the ngadmin structure.
620 * @param ic A pointer to an igmp_conf structure. Must not be NULL.
621 * @return ERR_OK when everything is well or an error code otherwise.
623 int ngadmin_getIGMPConf (struct ngadmin *nga, struct igmp_conf *ic);
627 * Set the IGMP configuration.
628 * Changes the IGMP configuration.
629 * @note You must be logged on a switch.
630 * @param nga A pointer to the ngadmin structure.
631 * @param ic A pointer to an igmp_conf structure. Must not be NULL.
632 * @return ERR_OK when everything is well or an error code otherwise.
634 int ngadmin_setIGMPConf (struct ngadmin *nga, const struct igmp_conf *ic);
638 * Perform a cable test.
639 * Performs a cable test on one ore more ports.
640 * @note Results are still raw values.
641 * @note This function takes a very long time.
642 * @note You must be logged on a switch.
643 * @param nga A pointer to the ngadmin structure.
644 * @param ct A pointer to an array of cabletest structures. Must not be NULL.
645 * @param nb The number of elements in the array.
646 * @return ERR_OK when everything is well or an error code otherwise.
648 int ngadmin_cabletest (struct ngadmin *nga, struct cabletest *ct, int nb);
652 * Set the network configuration.
653 * Changes the network configuration.
654 * @note You must be logged on a switch.
655 * @param nga A pointer to the ngadmin structure.
656 * @param nc A pointer to a net_conf structure. Must not be NULL. \n
657 Only non-zero fields of the structure are taken into account.
658 * @return ERR_OK when everything is well or an error code otherwise.
660 int ngadmin_setNetConf (struct ngadmin *nga, const struct net_conf *nc);
665 * Retrieves the VLAN type.
666 * @note You must be logged on a switch.
667 * @param nga A pointer to the ngadmin structure.
668 * @param t A pointer to an integer which will receive the VLAN type. Must not be NULL.
669 * @return ERR_OK when everything is well or an error code otherwise.
671 int ngadmin_getVLANType (struct ngadmin *nga, int *t);
676 * Changes the VLAN type.
677 * @note You must be logged on a switch.
678 * @param nga A pointer to the ngadmin structure.
679 * @param t An integer which contains the new VLAN type.
680 * @return ERR_OK when everything is well or an error code otherwise.
682 int ngadmin_setVLANType (struct ngadmin *nga, int t);
686 * Get the ports VLANs in port mode.
687 * Retrieves the associated VLAN of ports in port mode.
688 * @note The switch should be in port mode.
689 * @note You must be logged on a switch.
690 * @param nga A pointer to the ngadmin structure.
691 * @param ports A pointer to an array of integers which will receive the
692 number of associated VLAN. Must not be NULL.
693 * @return ERR_OK when everything is well or an error code otherwise.
695 int ngadmin_getVLANPortConf (struct ngadmin *nga, unsigned char *ports);
699 * Set the ports VLAN in port mode.
700 * Changes the associated VLAN of ports in port mode.
701 * @note The switch should be in port mode.
702 * @note You must be logged on a switch.
703 * @param nga A pointer to the ngadmin structure.
704 * @param ports A pointer to an array of integers which contain the
705 number of associated VLAN. Must not be NULL.
706 * @return ERR_OK when everything is well or an error code otherwise.
708 int ngadmin_setVLANPortConf (struct ngadmin *nga, const unsigned char *ports);
712 * Get all the 802.1q VLAN configuration.
713 * Retrieves all the VLAN configuration in 802.1q mode.
714 * @note The switch should be in 802.1q mode.
715 * @note You must be logged on a switch.
716 * @param nga A pointer to the ngadmin structure.
717 * @param vlans A pointer to an array of unsigned shorts which will receive
718 * VLAN ids. Must not be NULL. \n
719 * The array size must be sizeof(unsigned short)*(*nb).
720 * @param ports A pointer to an array of unsigned chars which will receive the
721 802.1q configuration for each VLAN. Must not be NULL. \n
722 The array size must be sizeof(unsigned char)*ports_count*(*nb).
723 * @param nb A pointer to an integer which contains the maximum number of
724 elements allowed in the array. Must not be NULL. \n
725 It will receive the actual number of VLAN written in the arrays.
726 * @return ERR_OK when everything is well or an error code otherwise.
728 int ngadmin_getVLANDotAllConf (struct ngadmin *nga, unsigned short *vlans, unsigned char *ports, int *nb);
732 * Get the configuration of a VLAN in 802.1q mode.
733 * Retrieves the configuration of a particular VLAN in 802.1q mode.
734 * @note The switch should be in 802.1q mode.
735 * @note You must be logged on a switch.
736 * @param nga A pointer to the ngadmin structure.
737 * @param vlan The VLAN you want to get the configuration.
738 * @param ports A pointer to an array of integers which will receive the
739 configuration. Must not be NULL.
740 * @return ERR_OK when everything is well or an error code otherwise.
742 int ngadmin_getVLANDotConf (struct ngadmin *nga, unsigned short vlan, unsigned char *ports);
746 * Set the configuration if a VLAN in 802.1q mode.
747 * Changes the configuration of a particular VLAN in 802.1q mode.
748 * @note The switch should be in 802.1q mode.
749 * @note You must be logged on a switch.
750 * @param nga A pointer to the ngadmin structure.
751 * @param vlan The VLAN you want to change the configuration.
752 * @param ports A pointer to an array of integers which contain the
753 configuration. Must not be NULL.
754 * @return ERR_OK when everything is well or an error code otherwise.
756 int ngadmin_setVLANDotConf (struct ngadmin *nga, unsigned short vlan, const unsigned char *ports);
760 * Destroy a VLAN in 802.1q mode.
761 * Destroys a particular VLAN in 802.1q mode.
762 * @note The switch should be in 802.1q mode.
763 * @note You must be logged on a switch.
764 * @param nga A pointer to the ngadmin structure.
765 * @param vlan The VLAN you want to destroy.
766 * @return ERR_OK when everything is well or an error code otherwise.
768 int ngadmin_VLANDestroy (struct ngadmin *nga, unsigned short vlan);
772 * Get the PVID values.
773 * Retrieves the PVID values of all the ports.
774 * @note You must be logged on a switch.
775 * @param nga A pointer to the ngadmin structure.
776 * @param ports A pointer to an array of unsigned shorts which will receive the
777 * PVID values. Must not be NULL. \n
778 * The array size must be sizeof(unsigned short)*ports_count.
779 * @return ERR_OK when everything is well or an error code otherwise.
781 int ngadmin_getAllPVID (struct ngadmin *nga, unsigned short *ports);
785 * Set the PVID of one port.
786 * Changes the PVID of one port.
787 * @note You must be logged on a switch.
788 * @param nga A pointer to the ngadmin structure.
789 * @param port The port you want to change PVID.
790 * @param vlan The new PVID value.
791 * @return ERR_OK when everything is well or an error code otherwise.
793 int ngadmin_setPVID (struct ngadmin *nga, unsigned char port, unsigned short vlan);