OpenBSD Journal

LOLCODE Scripting Added to OpenBSD Kernel

Contributed by tbert on from the in-ur-base-scripting-yr-kernel dept.

Given the need for constant feature implementation, and the difficulty normal users have altering their running kernels, the OpenBSD project, after nearly a year of testing and rejecting candidates, is proud to announce the selection of LOLCODE as the in-kernel scripting language.

Example code implementing a basic firewall function is found below:

KAN HAZ INTERNETZ?

BTW Filter packets based on source address
HOW DUZ I SOURCEFILTER YR MBUF

    I HAZ A IPHDR ITZ mtod(MBUF, (IPHDR *))

    IZ IPHDR->srcip "192.168.1.1"?
        YARLY
            BTW Have matched a blacklisted address; drop packet
            m_freem(MBUF)
        NOWAI
            BTW Just pass the packet
    KTHX

IF U SAY SO

One of the factors driving the adoption of LOLCODE was the unparalleled ability for writing interpreters for other languages, meaning that your options for kernel hacking are virtually limitless.

LOLCODE scripts are loaded/unloaded through the new lolctl(8) command, which accesses the new lol(4) device.

This should be currently available in snapshots; as always, widespread testing is key to a quality release!

(Comments are closed)


Comments
  1. By Denis (Denis) openbsd@ledeuns.net on

    The links to lol(4) manpage is broken :o

    Comments
    1. Comments
      1. By d.c. (212.67.86.138) on

        > This is a joke, right?
        And a good one!

  2. By Anonymous Coward (204.80.187.239) on

    Reminds me of LUA in the NetBSD kernel.

    Comments
    1. By Noryungi (noryungi) on

      > Reminds me of LUA in the NetBSD kernel.

      ORLY?? :-D

  3. By Anonymous Coward (160.83.30.147) peb.nowarra@bluewin.ch on

    Besides missing the manual pages I tried to hook up my Microsoft Dynamic Language Runtime and could not connect (maybe dotnet implementation ?). Also I am missing the authpf implementation.

  4. By sneaker (sneaker) sneaker@noahpugsley.net on

    Meh. I was way more excited about tedu's ZFS commit. Has me motivated to finish my firewire drivers.

  5. By Anonymous Coward (186.15.115.46) on

    I suppose that this allows to use translations too :-)

    Comments
    1. By better not to say my name (156.35.97.35) on

      > I suppose that this allows to use translations too :-)

      Indeed, NAT is supported too, but not shown on the firewall example. ;-)

Credits

Copyright © - Daniel Hartmeier. All rights reserved. Articles and comments are copyright their respective authors, submission implies license to publish on this web site. Contents of the archive prior to as well as images and HTML templates were copied from the fabulous original deadly.org with Jose's and Jim's kind permission. This journal runs as CGI with httpd(8) on OpenBSD, the source code is BSD licensed. undeadly \Un*dead"ly\, a. Not subject to death; immortal. [Obs.]