Lines 1775-1795
VNetSetMACUnique(VNetPort *port, // IN:
Link Here
|
1775 |
*---------------------------------------------------------------------- |
1775 |
*---------------------------------------------------------------------- |
1776 |
*/ |
1776 |
*/ |
1777 |
|
1777 |
|
1778 |
int |
1778 |
void |
1779 |
VNetPrintJack(const VNetJack *jack, // IN: jack |
1779 |
VNetPrintJack(const VNetJack *jack, // IN: jack |
1780 |
char *buf) // OUT: info about jack |
1780 |
struct seq_file *seqf) // OUT: info about jack |
1781 |
{ |
1781 |
{ |
1782 |
int len = 0; |
|
|
1783 |
|
1784 |
read_lock(&vnetPeerLock); |
1782 |
read_lock(&vnetPeerLock); |
1785 |
if (!jack->peer) { |
1783 |
if (!jack->peer) { |
1786 |
len += sprintf(buf+len, "connected not "); |
1784 |
seq_printf(seqf, "connected not "); |
1787 |
} else { |
1785 |
} else { |
1788 |
len += sprintf(buf+len, "connected %s ", jack->peer->name); |
1786 |
seq_printf(seqf, "connected %s ", jack->peer->name); |
1789 |
} |
1787 |
} |
1790 |
read_unlock(&vnetPeerLock); |
1788 |
read_unlock(&vnetPeerLock); |
1791 |
|
|
|
1792 |
return len; |
1793 |
} |
1789 |
} |
1794 |
|
1790 |
|
1795 |
|
1791 |
|
Lines 1809-1860
VNetPrintJack(const VNetJack *jack, // IN: jack
Link Here
|
1809 |
*---------------------------------------------------------------------- |
1805 |
*---------------------------------------------------------------------- |
1810 |
*/ |
1806 |
*/ |
1811 |
|
1807 |
|
1812 |
int |
1808 |
void |
1813 |
VNetPrintPort(const VNetPort *port, // IN: port |
1809 |
VNetPrintPort(const VNetPort *port, // IN: port |
1814 |
char *buf) // OUT: info about port |
1810 |
struct seq_file *seqf) // OUT: info about port |
1815 |
{ |
1811 |
{ |
1816 |
int len = 0; |
1812 |
VNetPrintJack(&port->jack, seqf); |
1817 |
|
1813 |
|
1818 |
len += VNetPrintJack(&port->jack, buf+len); |
1814 |
seq_printf(seqf, "mac %02x:%02x:%02x:%02x:%02x:%02x ", |
1819 |
|
|
|
1820 |
len += sprintf(buf+len, "mac %02x:%02x:%02x:%02x:%02x:%02x ", |
1821 |
port->paddr[0], port->paddr[1], port->paddr[2], |
1815 |
port->paddr[0], port->paddr[1], port->paddr[2], |
1822 |
port->paddr[3], port->paddr[4], port->paddr[5]); |
1816 |
port->paddr[3], port->paddr[4], port->paddr[5]); |
1823 |
|
1817 |
|
1824 |
len += sprintf(buf+len, "ladrf %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x ", |
1818 |
seq_printf(seqf, "ladrf %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x ", |
1825 |
port->ladrf[0], port->ladrf[1], port->ladrf[2], |
1819 |
port->ladrf[0], port->ladrf[1], port->ladrf[2], |
1826 |
port->ladrf[3], port->ladrf[4], port->ladrf[5], |
1820 |
port->ladrf[3], port->ladrf[4], port->ladrf[5], |
1827 |
port->ladrf[6], port->ladrf[7]); |
1821 |
port->ladrf[6], port->ladrf[7]); |
1828 |
|
1822 |
|
1829 |
len += sprintf(buf+len, "flags IFF_RUNNING"); |
1823 |
seq_printf(seqf, "flags IFF_RUNNING"); |
1830 |
|
1824 |
|
1831 |
if (port->flags & IFF_UP) { |
1825 |
if (port->flags & IFF_UP) { |
1832 |
len += sprintf(buf+len, ",IFF_UP"); |
1826 |
seq_printf(seqf, ",IFF_UP"); |
1833 |
} |
1827 |
} |
1834 |
|
1828 |
|
1835 |
if (port->flags & IFF_BROADCAST) { |
1829 |
if (port->flags & IFF_BROADCAST) { |
1836 |
len += sprintf(buf+len, ",IFF_BROADCAST"); |
1830 |
seq_printf(seqf, ",IFF_BROADCAST"); |
1837 |
} |
1831 |
} |
1838 |
|
1832 |
|
1839 |
if (port->flags & IFF_DEBUG) { |
1833 |
if (port->flags & IFF_DEBUG) { |
1840 |
len += sprintf(buf+len, ",IFF_DEBUG"); |
1834 |
seq_printf(seqf, ",IFF_DEBUG"); |
1841 |
} |
1835 |
} |
1842 |
|
1836 |
|
1843 |
if (port->flags & IFF_PROMISC) { |
1837 |
if (port->flags & IFF_PROMISC) { |
1844 |
len += sprintf(buf+len, ",IFF_PROMISC"); |
1838 |
seq_printf(seqf, ",IFF_PROMISC"); |
1845 |
} |
1839 |
} |
1846 |
|
1840 |
|
1847 |
if (port->flags & IFF_MULTICAST) { |
1841 |
if (port->flags & IFF_MULTICAST) { |
1848 |
len += sprintf(buf+len, ",IFF_MULTICAST"); |
1842 |
seq_printf(seqf, ",IFF_MULTICAST"); |
1849 |
} |
1843 |
} |
1850 |
|
1844 |
|
1851 |
if (port->flags & IFF_ALLMULTI) { |
1845 |
if (port->flags & IFF_ALLMULTI) { |
1852 |
len += sprintf(buf+len, ",IFF_ALLMULTI"); |
1846 |
seq_printf(seqf, ",IFF_ALLMULTI"); |
1853 |
} |
1847 |
} |
1854 |
|
1848 |
|
1855 |
len += sprintf(buf+len, " "); |
1849 |
seq_printf(seqf, " "); |
1856 |
|
|
|
1857 |
return len; |
1858 |
} |
1850 |
} |
1859 |
|
1851 |
|
1860 |
|
1852 |
|