dmitri alenitchev

September 27, 2006

Hacking USB device drivers->part 1

Filed under: OpenBSD — Dmitri Alenitchev @ 17:30

This is the first article from “Hacking USB device drivers” series. In this part very simple hack: adding missed vendor and product IDs for USB drivers.

  • Adding vendor and product IDs for USB drivers
    • Introduction
    • Changing USB IDs database
    • Result
  • Adding support for new devices to USB drivers (read)

(more…)

Updating IOS

Filed under: cisco — Dmitri Alenitchev @ 1:16

I update IOS on WS-C3560G-48TS to latest advanced version: 12.2(25)SEE2. Here is version string from show version command output:

Cisco IOS Software, C3560 Software (C3560-ADVIPSERVICESK9-M), Version 12.2(25)SEE2, RELEASE SOFTWARE (fc1)

And here is hardware string:

cisco WS-C3560G-48TS (PowerPC405) processor (revision C0) with 118784K/12280K bytes of memory.
Processor board ID FOC1028Z5W9
Last reset from power-on
1 Virtual Ethernet interface
52 Gigabit Ethernet interfaces

September 26, 2006

WS-C3560G-48TS

Filed under: cisco — Dmitri Alenitchev @ 20:03

I got new toy. ;-) This is Cisco Catalyst 3560G with 48 Ethernet 10/100/1000 ports. I create new category “cisco” in this blog, where all related to cisco devices posts will be posted.

Cisco Catalyst 3560 Series Switches

Porting libpci

Filed under: OpenBSD — Dmitri Alenitchev @ 13:56

Last night i’m start porting pci library from NetBSD to OpenBSD. Not so many work was needed and initial revision of this port was done less than one hour. I make some tests and.. looks like “just work”. ;-)

While i porting this library i found function, which present in NetBSD and not present in OpenBSD. It is pci_findproduct(). I make my own implementation of this function based on pci_findvendor() code (see /usr/src/sys/dev/pci/pci_subr.c file ). Here is code:

const char *
pci_findproduct(pcireg_t id_reg)
{
#ifdef PCIVERBOSE
        pci_product_id_t product = PCI_PRODUCT(id_reg);
        const struct pci_known_product *kp;        kp = pci_known_products;

        while (kp->productname != NULL) {       /* all have product name */
                if (kp->product == product)
                        break;
                kp++;
        }
        return (kp->productname);
#else
        return (NULL);
#endif
}

Here is very simple example of program using libpci:

#include <stdio.h>
#include <pci.h>int
main(int argc, char** argv)
{
        printf("%x is %sn", 0x1186, pci_findvendor((pcireg_t) 0x1186));
        printf("%x is %sn", 0x168c, pci_findvendor((pcireg_t) 0x168c));

return 0;
}

Compile and run this sample:

saturn% gcc -Wall -o pcilib pcilib.c -lpci
saturn% ./pcilib
1186 is D-Link Systems
168c is Atheros

I think this library may be useful for people, who don’t want teach pci(4) and use ioctl(2) for managing PCI devices.

TODO: Man page need to be rewritten and library code cleanup to style(9) also needed.

September 22, 2006

ath(4) testing

Filed under: OpenBSD — Dmitri Alenitchev @ 16:00

I have AR2413 cardbus device (D-Link DWL-G630):

ath0 at cardbus0 dev 0 function 0 “Atheros Communications, Inc., AR5001-0000-0000, Wireless LAN Reference Card”: irq 10
ath0: AR2413 7.8 phy 4.5 rf 5.6, FCC2A*, address 00:13:46:6e:a4:ef

The ath interface:

# ifconfig ath0 up
# ifconfig ath0
ath0: flags=8863 mtu 1500
        lladdr 00:13:46:6e:a4:ef
        media: IEEE802.11 autoselect (DS1 mode 11b)
        status: no network
        ieee80211: nwid default chan 4 bssid 00:13:46:7c:56:b5 23%
        inet6 fe80::213:46ff:fe6e:a4ef%ath0 prefixlen 64 scopeid 0x6

I can see 802.11b frames, and the cat get replies to probe requests, but association doesn’t work:

15:57:59.073693 0:13:46:6e:a4:ef > ff:ff:ff:ff:ff:ff, bssid ff:ff:ff:ff:ff:ff: 802.11: probe request, <radiotap v0, SHORTPRE, chan 4, 11b, txpower 30dBm>
15:58:02.744340 0:13:46:7c:56:b5 > 0:c:f1:62:2:a8, bssid 0:13:46:7c:56:b5: 802.11: probe response, ssid (default), rates, ds, country 71 66 32 1 13 14, erp, <radiotap v0, chan 4, 11b, rssi 18/64>
15:58:02.753001 0:13:46:7c:56:b5 > ff:ff:ff:ff:ff:ff, bssid 0:13:46:7c:56:b5: 802.11: beacon, ssid (default), rates, ds, tim, country 71 66 32 1 13 14, erp, xrates, <radiotap v0, chan 4, 11b, rssi 17/64>

September 20, 2006

AR2413 and AR5413 patch commited to -current

Filed under: OpenBSD — Dmitri Alenitchev @ 17:46

September 18, 2006

Screenshot

Filed under: OpenBSD — Dmitri Alenitchev @ 8:57

Screenshot from my laptop.

screenscreen Hosted on Zooomr

September 17, 2006

zsh and xterm window title

Filed under: FreeBSD, OpenBSD, Ubuntu — Dmitri Alenitchev @ 16:55

If you want see information from your shell (like current directory, user and hostname) in xterm window title just place the following lines in your ~/.zshrc file:

case $TERM in
    *xterm*)
        precmd () {print -Pn "\e]0;%n@%M: %~\a"}
        ;;
esac

P.S.: I use “*xterm*” in this example, because i have TERM like “color_xterm”, “xterm-sun” and “xterm-hp”, see /etc/termcap file.

September 13, 2006

New toys

Filed under: Default — Dmitri Alenitchev @ 16:32

At work I got two new toys. ;-)
DKVM-16 and DKVM-IP1. Testing in progress…
P.S.: I’m waiting for Cisco Catalyst 3560.

September 12, 2006

Many Common Names (CN) in one SSL certificate

Filed under: FreeBSD, OpenBSD, Ubuntu — Dmitri Alenitchev @ 21:08

Here is tip how to make one ssl certificate for many Common Names (CN).

You need add following strings to your openssl.cfg:

[ req_distinguished_name ]
0.commonName_default            = www.first-domain.com
0.commonName_max                = 64
1.commonName_default            = www.second-domain.com
1.commonName_max                = 64

..and use this config file for making certificate.

Older Posts »

Blog at WordPress.com.