Overview
Comment: | utils/ofatalkcfg: Add default phase and range |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
a143f672371b3555f150cf8797e245a2 |
User & Date: | js on 2023-04-12 07:47:43 |
Other Links: | manifest | tags |
Context
2023-04-12
| ||
08:37 | utils/ofatalkcfg: Make the code more portable check-in: 2fc4580a5f user: js tags: trunk | |
07:47 | utils/ofatalkcfg: Add default phase and range check-in: a143f67237 user: js tags: trunk | |
07:31 | utils/ofatalkcfg: Recommend "modprobe appletalk" check-in: d6812c8d19 user: js tags: trunk | |
Changes
Modified utils/ofatalkcfg/OFATalkCfg.m from [d5f21c75e8] to [54a3258015].
︙ | ︙ | |||
188 189 190 191 192 193 194 | } if (node > UINT8_MAX) { [OFStdErr writeFormat: @"%@: --node out of range!\n", [OFApplication programName]]; [OFApplication terminateWithStatus: 1]; } | | < < < < | | | | > | | | > | | | | | > > | < < < < | | | > | | | > | | | | | | | > | | | > | | | | > > > > | 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 | } if (node > UINT8_MAX) { [OFStdErr writeFormat: @"%@: --node out of range!\n", [OFApplication programName]]; [OFApplication terminateWithStatus: 1]; } if (phaseString != nil) { @try { phase = [phaseString unsignedLongLongValueWithBase: 0]; } @catch (OFInvalidFormatException *e) { [OFStdErr writeFormat: @"%@: Invalid format for "@"--phase!\n", [OFApplication programName]]; [OFApplication terminateWithStatus: 1]; } if (phase > 2) { [OFStdErr writeFormat: @"%@: --phase out of range!\n", [OFApplication programName]]; [OFApplication terminateWithStatus: 1]; } } else phase = 2; if (rangeString != nil) { rangeArray = [rangeString componentsSeparatedByString: @"-"]; if (rangeArray.count != 2) { [OFStdErr writeFormat: @"%@: Invalid format for --range!\n", [OFApplication programName]]; [OFApplication terminateWithStatus: 1]; } @try { rangeStart = [[rangeArray objectAtIndex: 0] unsignedLongLongValueWithBase: 0]; rangeEnd = [[rangeArray objectAtIndex: 1] unsignedLongLongValueWithBase: 0]; } @catch (OFInvalidFormatException *e) { [OFStdErr writeFormat: @"%@: Invalid format for --range!\n", [OFApplication programName]]; [OFApplication terminateWithStatus: 1]; } if (rangeStart > UINT16_MAX || rangeEnd > UINT16_MAX) { [OFStdErr writeFormat: @"%@: --range out of range!\n", [OFApplication programName]]; [OFApplication terminateWithStatus: 1]; } } else { rangeStart = network; rangeEnd = network; } configureInterface(optionsParser.remainingArguments.firstObject, (uint16_t)network, (uint8_t)node, (uint8_t)phase, (uint16_t)rangeStart, (uint16_t)rangeEnd); [OFApplication terminate]; } @end |