Full Code of diacritic/wssdl for AI

master b34ee13491ac cached
3 files
5.2 KB
1.6k tokens
1 requests
Download .txt
Repository: diacritic/wssdl
Branch: master
Commit: b34ee13491ac
Files: 3
Total size: 5.2 KB

Directory structure:
gitextract_ds7lidd5/

├── .gitignore
├── README.md
└── pack.lua

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================
*
!*/

!*.lua
!*.rst
!*.md

!.gitignore

wssdl.lua
test.lua


================================================
FILE: README.md
================================================
# 🝰 wssdl

[![Build Status](https://api.travis-ci.org/diacritic/wssdl.svg?branch=master)](https://travis-ci.org/diacritic/wssdl/builds) 
[![License (GPL)](https://img.shields.io/badge/license-GPLv3-blue.svg)](https://github.com/diacritic/wssdl/blob/master/LICENSE) 
[![Version (Experimental)](https://img.shields.io/github/release/diacritic/wssdl.svg?label=version)](https://github.com/diacritic/wssdl/releases/latest) 
[![Language (Lua)](https://img.shields.io/badge/powered_by-Lua-brightgreen.svg)](https://lua.org) 
[![Gitter chat](https://badges.gitter.im/diacritic/wssdl.png)](https://gitter.im/diacritic/wssdl) 

Wireshark-Specific Dissector Language

```lua
wssdl.packet {
  message     : u8();
  definition  : i32();
  done        : utf8z();
  easy        : ipv4();
}
```

## What is this?

wssdl is a domain specific language on top of lua built for the
purpose of expressing easily message dissectors.

## Documentation

| Stable | Latest |
| --- | --- |
[![Stable docs][doc-stable-badge]][doc-stable] | [![Latest docs][doc-latest-badge]][doc-latest]

Also check out some of the [samples][samples].

## Install

### From the release

Grab the bootstrapped `wssdl.lua` from the [latest release][latest],
and put it in your Wireshark Plugin directory
(usually `~/.config/wireshark/plugins`, `~/.wireshark/plugins` or `/usr/lib/wireshark/<version>`)

### From source

The build toolchain needs lua 5.1 or newer, luarocks and the luafilesystem
module.

Clone this repository, and from the root directory call `make install`
to install it to `~/.config/wireshark/plugins`, or
`make WS_PLUGIN_DIR=/your/path install` to install it to the path of your choice.

[latest]: https://github.com/diacritic/wssdl/releases/latest
[samples]: https://github.com/diacritic/wssdl/tree/master/samples

[doc-stable]:       http://wssdl.readthedocs.io/en/stable/?badge=stable
[doc-latest]:       http://wssdl.readthedocs.io/en/latest/?badge=latest
[doc-stable-badge]: https://readthedocs.org/projects/wssdl/badge/?version=stable
[doc-latest-badge]: https://readthedocs.org/projects/wssdl/badge/?version=latest


================================================
FILE: pack.lua
================================================
--
--  Copyright 2016 diacritic <https://diacritic.io>
--
--  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 3 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, see <http://www.gnu.org/licenses/>.
--

require 'luarocks.loader'

local fs = require 'lfs'

local args = {...}
local root = args[1]:gsub('/$', ''):gsub('\\$', '')
local files = {}

function scandir(root, path)
  -- adapted from http://keplerproject.github.com/luafilesystem/examples.html
  path = path or ''
  for file in fs.dir(root..path) do
    if file ~= '.' and file ~= '..' then
      local f = path .. '/' .. file
      local attr = lfs.attributes(root..f)
      assert(type(attr) == 'table')
      if attr.mode == 'directory' then
        scandir(root, f)
      else
        if file:find('%.lua$') then
          hndl = (f:gsub('%.lua$', '')
              :gsub('/', '.')
              :gsub('\\', '.')
              :gsub('^%.', '')
            ):gsub('%.init$', '')
          files[hndl] = io.open(root..f):read('*a')
              :gsub(' *%-%-[^\n]*\n', '')
        end
      end
    end
  end
  return files
end

scandir(root)

acc = { [[
--
--  Copyright 2016 diacritic <https://diacritic.io>
--
--  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 3 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, see <http://www.gnu.org/licenses/>.
--
]] }

local wrapper = { '\n--------------------------------------\npackage.preload[\'', nil, '\'] = function (...)\n', nil, '\nend\n' }

for k,v in pairs( files ) do
  wrapper[2], wrapper[4] = k, v
  table.insert(acc, table.concat(wrapper))
end

table.insert(acc, [[
-----------------------------------------------

do
  if not package.__loadfile then
    local original_loadfile = loadfile
    local function lf(file)
      local hndl = file:gsub('%.lua$', '')
                       :gsub('/', '.')
                       :gsub('\\', '.')
                       :gsub('%.init$', '')
      return package.preload[hndl] or original_loadfile(name)
    end

    function dofile(name)
      return lf(name)()
    end

    loadfile, package.__loadfile = lf, loadfile
  end
end

return require 'wssdl.core'
]])

print(table.concat(acc))
Download .txt
gitextract_ds7lidd5/

├── .gitignore
├── README.md
└── pack.lua
Condensed preview — 3 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (6K chars).
[
  {
    "path": ".gitignore",
    "chars": 60,
    "preview": "*\n!*/\n\n!*.lua\n!*.rst\n!*.md\n\n!.gitignore\n\nwssdl.lua\ntest.lua\n"
  },
  {
    "path": "README.md",
    "chars": 2098,
    "preview": "# 🝰 wssdl\n\n[![Build Status](https://api.travis-ci.org/diacritic/wssdl.svg?branch=master)](https://travis-ci.org/diacriti"
  },
  {
    "path": "pack.lua",
    "chars": 3180,
    "preview": "--\n--  Copyright 2016 diacritic <https://diacritic.io>\n--\n--  This program is free software: you can redistribute it and"
  }
]

About this extraction

This page contains the full source code of the diacritic/wssdl GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 3 files (5.2 KB), approximately 1.6k tokens. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!