Overview
Comment: | Added brctl support |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
2d80cf430beea1030b4a0dd85de2064c |
User & Date: | rkeene on 2012-08-22 03:31:33 |
Other Links: | manifest | tags |
Context
2012-08-22
| ||
03:36 | Added stub for "vconfig" check-in: 1fce677508 user: rkeene tags: trunk | |
03:31 | Added brctl support check-in: 2d80cf430b user: rkeene tags: trunk | |
2012-08-11
| ||
23:17 | Corrected bug in "ifconfig" check-in: 704748fc41 user: rkeene tags: trunk | |
Changes
Modified build-dyn.sh from [02da656833] to [078554ca42].
1 2 3 4 5 6 | 1 2 3 4 5 6 7 8 9 10 11 12 | - + - - + + | # /bin/bash # Perform common build options . build-common.sh # Compile using the same options as Tcl |
Modified system.c from [382721d0da] to [1594c1fd70].
︙ | |||
16 17 18 19 20 21 22 23 24 25 26 27 28 29 | 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | + | #include <errno.h> #include <tcl.h> #include <linux/sockios.h> #include <linux/route.h> #include <linux/if.h> #include <linux/if_arp.h> #include <linux/if_bridge.h> #include <linux/loop.h> #include <linux/fs.h> #ifndef HOST_NAME_MAX /* SUSv2 Limit */ #define HOST_NAME_MAX 255 #endif |
︙ | |||
114 115 116 117 118 119 120 121 122 123 124 125 126 127 | 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | hashval_obj = Tcl_NewObj(); Tcl_SetWideIntObj(hashval_obj, hashval); Tcl_SetObjResult(interp, hashval_obj); return(TCL_OK); } static int tclsystem_internal_getsock(int *sock_v4_out, int *sock_v6_out) { int sock_v4 = -1, sock_v6 = -1; int sock; if (sock_v4_out == NULL && sock_v6_out == NULL) { return(-1); } if (sock_v4_out != NULL) { /* * Check for IPv4 support before trying to create an IPv4 socket to * avoid demand-loading IPv4 (XXX: TODO) */ sock_v4 = socket(AF_INET, SOCK_DGRAM, 0); } if (sock_v6_out != NULL) { /* * Check for IPv6 support before trying to create an IPv6 socket to * avoid demand-loading IPv6 (XXX: TODO) */ sock_v6 = socket(AF_INET6, SOCK_DGRAM, 0); } /* Pick a socket to query for the interface list */ if (sock_v4 == -1 && sock_v6 == -1) { return(-1); } if (sock_v6 != -1) { sock = sock_v6; } else { sock = sock_v4; } if (sock_v4_out != NULL) { *sock_v4_out = sock_v4; } if (sock_v6_out != NULL) { *sock_v6_out = sock_v6; } return(sock); } /* * Low-level System Call Wrapper Procedures * * These procedures should minimally wrap Linux or UNIX system calls to * expose to the Tcl-level. Where possible accept symbolic names rather * than numeric values (.e.g, list of values to OR together to get flags). |
︙ | |||
1411 1412 1413 1414 1415 1416 1417 | 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 | - - - - - - + - - - - - - + - - - - - - - - - | return(TCL_OK); } static int tclsystem_ifconfig(ClientData cd, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { int sock_v4, sock_v6, sock; int retval = TCL_ERROR; |
︙ | |||
1656 1657 1658 1659 1660 1661 1662 | 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 | - - - - - - + - - - - - - + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | return(TCL_OK); } static int tclsystem_route(ClientData cd, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { int sock_v4, sock_v6, sock; int retval = TCL_ERROR; |
︙ | |||
1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 | 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 | + | Tcl_CreateObjCommand(interp, "::system::syscall::kill", tclsystem_kill, NULL, NULL); Tcl_CreateObjCommand(interp, "::system::syscall::ps", tclsystem_ps, NULL, NULL); Tcl_CreateObjCommand(interp, "::system::syscall::execve", tclsystem_execve, NULL, NULL); /* Network related commands */ Tcl_CreateObjCommand(interp, "::system::syscall::ifconfig", tclsystem_ifconfig, NULL, NULL); Tcl_CreateObjCommand(interp, "::system::syscall::route", tclsystem_route, NULL, NULL); Tcl_CreateObjCommand(interp, "::system::syscall::brctl", tclsystem_brctl, NULL, NULL); /* Internal functions */ Tcl_CreateObjCommand(interp, "::system::internal::hash", tclsystem_internalproc_simplehash, NULL, NULL); /* Define constants */ /** Create parent namespace **/ Tcl_CreateNamespace(interp, "::system::const", NULL, NULL); |
︙ |