# Adding a New Protocol under Windows

**URL:** https://discuss.elastic.co/t/adding-a-new-protocol-under-windows/37247
**Category:** Beats
**Tags:** packetbeat
**Created:** [December 15, 2015, 2:53pm UTC](https://discuss.elastic.co/t/adding-a-new-protocol-under-windows/37247 "2015-12-15T14:53:58Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![knobli](https://avatars.discourse-cdn.com/v4/letter/k/bbce88/32.png) [@knobli](https://discuss.elastic.co/u/knobli)
#### Post date: [December 15, 2015, 2:53pm UTC](https://discuss.elastic.co/t/adding-a-new-protocol-under-windows/37247/1 "2015-12-15T14:53:58Z")

</div>

I'm trying to add a new protocol to packetbeat under Windows. I noticed that the "[Developer Guide: Adding a New Protocol](https://www.elastic.co/guide/en/beats/packetbeat/current/_developer_guide_adding_a_new_protocol.html)" is not up to date.

I read that the git repository and the dependency management changed. I don't know if there are some other point to be aware of.

I installed:

- go: 1.5.1 windows/amd64
- Bazaar: 2.5.1-1
- Cygwin: 2.3.0 x86\_64 (with make)

I try to run some commands to build packetbeat and some errors have occurred.

Direcotry:  
`/cygdrive/c/dev/workspace/src/github.com/elastic/beats/packetbeat`

During _go get_:

```
$ go get
# github.com/elastic/beats/vendor/github.com/tsg/gopacket/pcap
C:\Dev\workspace\src\github.com\elastic\beats\vendor\github.com\tsg\gopacket\pcap\pcap.go:18:18: fatal error: pcap.h: No such file or directory
 #include <pcap.h>
  ^
compilation terminated.

```

The same during _make_:

```
$ make
go build
# github.com/elastic/beats/vendor/github.com/tsg/gopacket/pcap
C:\Dev\workspace\src\github.com\elastic\beats\vendor\github.com\tsg\gopacket\pcap\pcap.go:18:18: fatal error: pcap.h: No such file or directory
 #include <pcap.h>
  ^
compilation terminated.
../libbeat/scripts/Makefile:

```

Did I do something wrong? Or should I install another tool?

---

<div class="post-metadata">

### Author: ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)
#### Post date: [December 15, 2015, 5:08pm UTC](https://discuss.elastic.co/t/adding-a-new-protocol-under-windows/37247/2 "2015-12-15T17:08:53Z")

</div>

It looks like you are missing the [WinPcap developer pack](https://www.winpcap.org/install/bin/WpdPack_4_1_2.zip). This thread has more details: [[SOLVED] Build packetbeat on windows](https://discuss.elastic.co/t/solved-build-packetbeat-on-windows/35161/7)

---

<div class="post-metadata">

### Author: ![knobli](https://avatars.discourse-cdn.com/v4/letter/k/bbce88/32.png) [@knobli](https://discuss.elastic.co/u/knobli)
#### Post date: [December 16, 2015, 10:48am UTC](https://discuss.elastic.co/t/adding-a-new-protocol-under-windows/37247/3 "2015-12-16T10:48:17Z")

</div>

Thanks @andrewkroh

I installed WinPcap and now it works fine.

I also tried the vagrant box, it's really simple, good job.  
But I'm not able to run `make`. Is it not needed?

---

<div class="post-metadata">

### Author: ![steffens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steffens/32/79630_2.png) [@steffens](https://discuss.elastic.co/u/steffens)
#### Post date: [December 16, 2015, 4:53pm UTC](https://discuss.elastic.co/t/adding-a-new-protocol-under-windows/37247/4 "2015-12-16T16:53:54Z")

</div>

@knobli which protocol you want to work on? I think it's a good idea to comment in a [github ticket](https://github.com/elastic/beats/issues?q=is%3Aopen+is%3Aissue+label%3A%22new+protocol%22) or create a new one to see if there's some more interest or some people being interested to help with implementation or testing.

---

<div class="post-metadata">

### Author: ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)
#### Post date: [December 16, 2015, 5:19pm UTC](https://discuss.elastic.co/t/adding-a-new-protocol-under-windows/37247/5 "2015-12-16T17:19:52Z")

</div>

@knobli It would be nice if `make` worked inside the vagrant box, but since most of us do not use Windows as our primary development environment it hasn't been needed. On Windows I have just been issuing the build and test commands manually or through a batch script. See [make.bat](https://github.com/elastic/beats/blob/master/winlogbeat/make.bat).

---

<div class="post-metadata">

### Author: ![bering](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bering/32/4044_2.png) [@bering](https://discuss.elastic.co/u/bering)
#### Post date: [December 16, 2015, 11:19pm UTC](https://discuss.elastic.co/t/adding-a-new-protocol-under-windows/37247/6 "2015-12-16T23:19:35Z")

</div>

I did not use make on windows to build packetbeat, I just used `go build` from my packetbeat directory, also the command prompt needed to run as administrator.

---

<div class="post-metadata">

### Author: ![knobli](https://avatars.discourse-cdn.com/v4/letter/k/bbce88/32.png) [@knobli](https://discuss.elastic.co/u/knobli)
#### Post date: [December 17, 2015, 8:52am UTC](https://discuss.elastic.co/t/adding-a-new-protocol-under-windows/37247/7 "2015-12-17T08:52:47Z")

</div>

@steffens I'm working on the smpp protocol ([knobli/beats](https://github.com/knobli/beats)). Initially I only want to parse the payload in hex data and forward it. I can process it later in logstash with my [smpp filter](https://github.com/knobli/logstash-filter-smpp).

Thanks for the inputs. I will start a unix system for the other steps. Is there a preconfigured vagrant box or docker image for a unix developer environment?

Is there a way to create the **packetbeat.test** executable under windows to run the python system tests?

---

<div class="post-metadata">

### Author: ![steffens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steffens/32/79630_2.png) [@steffens](https://discuss.elastic.co/u/steffens)
#### Post date: [December 17, 2015, 9:29pm UTC](https://discuss.elastic.co/t/adding-a-new-protocol-under-windows/37247/8 "2015-12-17T21:29:42Z")

</div>

the packetbeat.test binary is build via `go test -c -covermode=atomic -coverpkg ./...`

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 5, 2017, 9:57pm UTC](https://discuss.elastic.co/t/adding-a-new-protocol-under-windows/37247/9 "2017-07-05T21:57:25Z")

</div>


