* Swaps given table with @second one. */
| 665 | * Swaps given table with @second one. |
| 666 | */ |
| 667 | static int |
| 668 | table_swap(ipfw_obj_header *oh, char *second) |
| 669 | { |
| 670 | |
| 671 | if (table_check_name(second) != 0) |
| 672 | errx(EX_USAGE, "table name %s is invalid", second); |
| 673 | |
| 674 | if (table_do_swap(oh, second) == 0) |
| 675 | return (0); |
| 676 | |
| 677 | switch (errno) { |
| 678 | case EINVAL: |
| 679 | errx(EX_USAGE, "Unable to swap table: check types"); |
| 680 | case EFBIG: |
| 681 | errx(EX_USAGE, "Unable to swap table: check limits"); |
| 682 | } |
| 683 | |
| 684 | return (0); |
| 685 | } |
| 686 | |
| 687 | |
| 688 | /* |
no test coverage detected