MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / StrToVlanId

Function StrToVlanId

NetworkPkg/Application/VConfig/VConfig.c:328–349  ·  view source on GitHub ↗

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. **/

Source from the content-addressed store, hash-verified

326
327**/
328UINT16
329StrToVlanId (
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.

Callers 2

AddVlanFunction · 0.85
DeleteVlanFunction · 0.85

Calls 1

StrDecimalToUintnFunction · 0.85

Tested by

no test coverage detected