input: add generic PCAP interface for LAPD

This patch allows you to create PCAP traces between the BSC and BTS including
the LAPD frames. Useful for debugging communication issues.

So far, it was only possible to create layer 3 traces containing
OML/RSL. LAPD traces can be also interesting to debug communication
issues between the BSC and the BTS.

To enable PCAP of LAPD, you only have to invoke:

li->pcap_fd = osmo_pcap_lapd_open("/tmp/file.pcap", 0600);

By default, li->pcap_fd is set to -1 which means disabled.

openBSC needs a patch to replace all usage of e1_set_pcap_fd by
osmo_pcap_lapd_open.
diff --git a/include/osmocom/abis/lapd_pcap.h b/include/osmocom/abis/lapd_pcap.h
new file mode 100644
index 0000000..1c0d555
--- /dev/null
+++ b/include/osmocom/abis/lapd_pcap.h
@@ -0,0 +1,11 @@
+#ifndef _LAPD_PCAP_H_
+#define _LAPD_PCAP_H_
+
+#define OSMO_LAPD_PCAP_INPUT	0
+#define OSMO_LAPD_PCAP_OUTPUT	1
+
+int osmo_pcap_lapd_open(char *filename, mode_t mode);
+int osmo_pcap_lapd_write(int fd, int direction, struct msgb *msg);
+int osmo_pcap_lapd_close(int fd);
+
+#endif