From 56d4b0f73d20f1104a304573aac565db10446262 Mon Sep 17 00:00:00 2001 From: hunz Date: Sat, 22 Mar 2003 07:16:44 +0000 Subject: [PATCH] *shower* :-) --- parse.pl | 27 +++++- render.c | 230 ++++++++++++++++++++++++++++++++++++++++++++ wlan1/header | 11 +++ wlan1/wlan1-content | 14 +-- wlan1/wlan1.xml | 211 +++++++++++++++++++++++++++++----------- 5 files changed, 420 insertions(+), 73 deletions(-) create mode 100644 render.c create mode 100644 wlan1/header diff --git a/parse.pl b/parse.pl index e071258..0dbf9a0 100755 --- a/parse.pl +++ b/parse.pl @@ -5,7 +5,8 @@ chomp @content; @slide=(); -@actions=( "slide top", +@actions=( "", + "slide top", "slide top right", "slide top left", "slide bottom", @@ -20,6 +21,17 @@ print "\n"; +@topics=(); + +foreach(@content) { + if((/^\d/) or (/^ \d/)) { + push(@topics,$_); + #print STDERR "$_\n"; + } +} + +$topic=0; + push(@content," 23"); foreach(@content) { @@ -40,7 +52,8 @@ foreach(@content) { if(@slide) { print "\n"; pop(@slide); - print "
$topic
\n\n"; + print STDERR "$topics[$topic]\n"; + print "
$topics[$topic]
\n\n"; foreach(@slide) { if(/^ \+ /) { s/\+//; @@ -55,14 +68,18 @@ foreach(@content) { } } print "
\n\n"; + #$topic++; } @slide=(); - #push(@slide,$_); - $topic=$_; + $topic++; + $_=$topics[$topic]; + if(/^\d/) { + $topic++; + } } # ueberpunkt elsif (/^\d/) { - #$topic=$_; + } # normaler content else { diff --git a/render.c b/render.c new file mode 100644 index 0000000..883693a --- /dev/null +++ b/render.c @@ -0,0 +1,230 @@ +/* DirectFB presentation app + * + * Copyright (C) 2001 convergence integrated media + * Authors: Sven Neumann + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + + +#include +#include + +#include + +#include + +#include "apptypes.h" + +#include "action.h" +#include "context.h" +#include "header.h" +#include "image.h" +#include "listitem.h" +#include "render.h" +#include "resources.h" +#include "slides.h" +#include "slide.h" +#include "text.h" +#include "video.h" + + +static void render_bullet (Context *context, + gint *offx, + gint offy); + +void +render_bg (Context *context) +{ + guchar *color; + + color = context_get_bgcolor (context); + context->surface->SetColor (context->surface, + color[0], color[1], color[2], color[3]); + context->surface->FillRectangle (context->surface, + 0, 0, context->w, context->h); +} + +void +render_bgimage (Context *context) +{ + gchar *image; + + image = context_get_bgimage (context); + if (image) + { + IDirectFBSurface *src; + gint w, h; + + src = resources_get_surface (image); + if (!src) + return; + + src->GetSize (src, &w, &h); + + if (w == context->w && h == context->h) + { + context->surface->Blit (context->surface, src, NULL, 0, 0); + } + else + { + DFBRectangle rect = { 0, 0, context->w, context->h }; + + context->surface->StretchBlit (context->surface, + src, NULL, &rect); + } + + resources_release_surface (image); + } +} + +void +render_image (Context *context, + Image *image) +{ + Item *item; + IDirectFBSurface *src; + DFBRectangle rect; + DFBSurfacePixelFormat format; + gint w, h, ratio; + + if (IS_VIDEO (image)) + { + Video *video; + + video = (Video *) image; + video->dest_surface = context->surface; + + return; + } + + src = resources_get_surface (ITEM (image)->value); + + if (!src) + return; + + src->GetSize (src, &w, &h); + src->GetPixelFormat (src, &format); + + if (format == DSPF_ARGB) + context->surface->SetBlittingFlags (context->surface, + DSBLIT_BLEND_ALPHACHANNEL); + + ratio = (w * 1024) / h; + item = (Item *) image; + + rect.w = item->flags & WIDTH ? + item->width : (item->flags & HEIGHT ? (item->height * ratio) / 1024 : w); + rect.h = item->flags & HEIGHT ? + item->height : (item->flags & WIDTH ? (item->width * 1024) / ratio : h); + + rect.x = item->flags & XOFFSET ? item->x : 0; + rect.y = item->flags & YOFFSET ? item->y : 0; + + if (format == DSPF_ARGB) + context->surface->SetBlittingFlags (context->surface, + DSBLIT_BLEND_ALPHACHANNEL); + + if (w == rect.w || h == rect.h) + context->surface->Blit (context->surface, src, NULL, rect.x, rect.y); + else + context->surface->StretchBlit (context->surface, src, NULL, &rect); + + context->surface->SetBlittingFlags (context->surface, DSBLIT_NOFX); + + resources_release_surface (ITEM (image)->value); +} + +void +render_text (Context *context, + Text *text, + gint *offy) +{ + guchar *color; + gchar *face; + gint size; + gint offx; + IDirectFBFont *font; + + context_push (context, (Item *) text); + + color = context_get_fgcolor (context); + context->surface->SetColor (context->surface, + color[0], color[1], color[2], color[3]); + + face = context_get_face (context); + size = context_get_size (context); + + g_return_if_fail (face != NULL); + g_return_if_fail (size > 0); + + offx = 10; + + if (IS_HEADER (text)) + size = (size * 64) / 52; + else if (IS_LISTITEM (text)) + size = (size * 48) / 64; + else + offx+=40; + + font = resources_get_font (face, size); + + if (IS_LISTITEM (text)) + { + gint asc; + + font->GetAscender (font, &asc); + render_bullet (context, &offx, *offy + asc); + } + + context->surface->SetFont (context->surface, font); + context->surface->DrawString (context->surface, + ITEM (text)->value, -1, + offx, *offy, DSTF_TOPLEFT); + + *offy += (size * 64) / 48; + + context_pop (context, (Item *) text); +} + +static void +render_bullet (Context *context, + gint *offx, + gint offy) +{ + IDirectFBSurface *src; + gchar *image; + gint w, h; + + image = context_get_bullet (context); + if (image) + { + src = resources_get_surface (image); + if (!src) + return; + + src->GetSize (src, &w, &h); + + context->surface->SetBlittingFlags (context->surface, + DSBLIT_BLEND_ALPHACHANNEL); + context->surface->Blit (context->surface, + src, NULL, *offx + 20, offy - h); + context->surface->SetBlittingFlags (context->surface, DSBLIT_NOFX); + + resources_release_surface (image); + + *offx += w + 24; + } +} diff --git a/wlan1/header b/wlan1/header new file mode 100644 index 0000000..3ca4eb6 --- /dev/null +++ b/wlan1/header @@ -0,0 +1,11 @@ +# T^WaveLAN +# D^Teil 1: Wireless LAN unter Linux +# A^Benedikt 'Hunz' Heinz, Frank Zirkelbach +# M^hunz@hunz.org, frank@luga.de +# E^Linuxinfotag 2003 +# L^FH-Augsburg + +# X^1024 +# Y^768 + + diff --git a/wlan1/wlan1-content b/wlan1/wlan1-content index f41f39c..818d163 100644 --- a/wlan1/wlan1-content +++ b/wlan1/wlan1-content @@ -1,13 +1,3 @@ -# T^WaveLAN -# D^Teil 1: Wireless LAN unter Linux -# A^Benedikt 'Hunz' Heinz, Frank Zirkelbach -# M^hunz@hunz.org, frank@luga.de -# E^Linuxinfotag 2003 -# L^FH-Augsburg - -# X^1024 -# Y^768 - 1 Einfuehrung 1.1 Was ist Wireless LAN? + Drahtlose Netzwerk Technologie @@ -115,5 +105,5 @@ + config: ssid / wepkeys / channel setzen wie oben hidden mode mit iwpriv ethX hidden 1 -4 Sicherheit - WaveLAN unsicher! Mehr dazu siehe Vortrag 2! +#4 Sicherheit +# WaveLAN unsicher! Mehr dazu siehe Vortrag 2! diff --git a/wlan1/wlan1.xml b/wlan1/wlan1.xml index 897d6cf..ba01f4d 100644 --- a/wlan1/wlan1.xml +++ b/wlan1/wlan1.xml @@ -1,79 +1,178 @@ - - - + - - -
-
WaveLAN
-
-
Teil 1: Wireless LAN unter Linux
-
-Benedikt 'Hunz' Heinz, Frank Zirkelbach - -email: hunz@hunz.org, frank@luga.de -event: Linuxinfotag 2003 -location: FH-Augsburg + +
1.1 Was ist Wireless LAN?
+ + + Drahtlose Netzwerk Technologie + + 2.4 GHz Bereich, 14 Channels (unterschiedl. Frequenzen) + + Übertragungsraten 1 - 54 MBit
-
-
Inhalt
-
- -1 Einfuehrung - - 1.1 Was ist Wireless LAN? - 1.2 WaveLAN Hardware - -2 Funktionsweise - - 2.1 Begriffserklaerungen - 2.2 Managed Mode - 2.3 AdHoc Mode - 2.4 WDS - -3 WaveLAN unter Linux - - 3.1 Vorraussetzungen - 3.2 Client Setup - 3.3 AP Setup - -4 Sicherheit - - +
1.2 WaveLAN Hardware
+ + + Accesspoint 120 - 800 Euro + auch als DSL-Router + siehe Punkt 5 + + WaveLAN Karten 30 - 150 Euro + 22 MBit +40 Euro, 54 MBit > 100 Euro + + Bundles (z.B. AP, 2 Karten) billiger + + Antennen (Planar, Omnidirektional, Richt) + http://www.turnpoint.net/wireless/cantennahowto.html + Aber: nicht alle Karten/APs haben (gleichen) Antennenanschluss + maximale Reichweiten 2 - 20 km (nicht alles erlaubt)
-
-
1 Einfuehrung
-
- +
2.1 Begriffserklaerungen
+ + + SSID: Netzwerkname + + WEP: Verschluesselung (RC4) + + 40 (64) oder 104 (128) Bit Schluessellaenge
-
-
2 Funktionsweise
-
+
2.2 Managed Mode
+ + + Dazu meldet sich jeder Client an einem AccessPoint an + Der AP stellt so die Verbindung zum Ethernet her + Bsp.: {Client} ~~~ (AP)---[Ethernet] + + Channel wird vom AP festgelegt + + Client wird auf selbe SSID wie AP konfiguriert (automat.) + + Client muss die selben WEPkeys benutzen wie AP + + An einem Ethernet koennen mehrere APs angeschlossen werden + +
+ +
2.3 AdHoc Mode
+ + + Nur Wireless Clients ohne AP + + daher keine Ethernetverbindung + + Clients muessen selben Channel, SSID und WEPkey haben + Bsp.: {Client 1} ~~~ {Client 2} ~~~ ...
-
-
3 WaveLAN unter Linux
-
+
2.4 WDS
+ + + Mehrere Ethernets ohne direkte Verbindun werden durch AccessPoints verbunden + + keine Clients noetig + + APs muessen auf selbem Channel sein und die selben WEPkeys haben +
+ +
3.1 Vorraussetzungen
+ + + Kernel + http://www.kernel.org (>=2.4.20 - nicht unbedingt pre/testing/2.5) + hier: kein PCMCIA Support im Kernel sondern pcmcia-cs + Network device support ---> + [*] Network device support + ... + Wireless LAN (non-hamradio) ---> + [*] Wireless LAN (non-hamradio) + fuer PCI Karten auch: + <M> Hermes chipset 802.11b support (Orinoco/Prism2/Symbol) + <M> Hermes in PLX9052 based PCI adaptor support + <M> Prism 2.5 PCI 802.11b adaptor support + + wireless_tools + http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html + + linux/wireless.h installen + entweder wireless.h ueber /usr/include/linux/wireless.h kopieren oder + bei neuem kernel /usr/include/linux nach /usr/src/linux/include/linux linken + + compilen + make + sudo make install + /etc/ld.so.conf: /usr/local/lib/ (falls noetig) && ldconfig + + pcmcia-cs (hier - weil nicht im Kernel) + http://pcmcia-cs.sourceforge.net + + compilen: + make config (interaktiv) + make all && make install + + config: card Eintrag in /etc/pcmcia/config (cardctl info)
-
-
4 Sicherheit
-
+
3.2 Client Setup
+ + + setzen des WEPkeys + iwconfig eth0 key s:123456789abcd (104 Bit key benutzen, wenn supported!) + + setzen der SSID + iwconfig eth0 essid "" oder iwconfig eth0 essid any + + Wireless device hochfahren +
+ +
3.3 AP Setup
+ + + Chipsatz + http://www.seattlewireless.net/index.cgi/HardwareComparison + Prism: HostAP http://hostap.epitest.fi + Lucent: HermesAP http://hunz.org/hermesap.html + + HostAP + Treiber, der IEEE 802.11 management Funktionen am Host Computer uebernimmt + + build: + cp -a hostap/driver/* ./pcmcia-cs/ + jetzt wie bei pcmcia-cs + + config: + card Eintrag in /etc/pcmcia/hostap_cs.conf (cardctl info) + iwconfig wlan0 essid "foobar" (default "test") + iwconfig wlan0 channel X (zum setzen des channels) + + HermesAP + Erweiterter Orinoco Treiber, der AP-Firmware benutzt + + build: + aus driver/orinoco-0.13b-hermesap-0.1a/ *.c *.h ins wireless dir von pcmcia-cs kopieren + pcmcia-cs wie oben compilen + + AP firmware extrahieren und laden: + im firmware dir ./hfwget.sh ausfuehren + dann firmware mit hfw/hfwload ethX firmware/T108580.hfw laden + + config: + ssid / wepkeys / channel setzen wie oben + hidden mode mit iwpriv ethX hidden 1 +
-- 2.20.1