Convert a NULL-terminated unicode decimal VLAN ID string to VLAN ID. @param[in] String Pointer to VLAN ID string from user input. @retval Value translated from String, or INVALID_VLAN_ID is string is invalid. **/
| 326 | |
| 327 | **/ |
| 328 | UINT16 |
| 329 | StrToVlanId ( |
| 330 | IN CHAR16 *String |
| 331 | ) |
| 332 | { |
| 333 | CHAR16 *Str; |
| 334 | |
| 335 | if (String == NULL) { |
| 336 | return INVALID_VLAN_ID; |
| 337 | } |
| 338 | |
| 339 | Str = String; |
| 340 | while ((*Str >= '0') && (*Str <= '9')) { |
| 341 | Str++; |
| 342 | } |
| 343 | |
| 344 | if (*Str != 0) { |
| 345 | return INVALID_VLAN_ID; |
| 346 | } |
| 347 | |
| 348 | return (UINT16) StrDecimalToUintn (String); |
| 349 | } |
| 350 | |
| 351 | /** |
| 352 | Add a VLAN device. |
no test coverage detected