Updated through tag hostap_2_5 from git://w1.fi/hostap.git
[mech_eap.git] / libeap / src / l2_packet / l2_packet_none.c
index 5e3f6e9..307fc6d 100644 (file)
@@ -2,14 +2,8 @@
  * WPA Supplicant - Layer2 packet handling example with dummy functions
  * Copyright (c) 2003-2005, Jouni Malinen <j@w1.fi>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * Alternatively, this software may be distributed under the terms of BSD
- * license.
- *
- * See README and COPYING for more details.
+ * This software may be distributed under the terms of the BSD license.
+ * See README for more details.
  *
  * This file can be used as a starting point for layer2 packet implementation.
  */
@@ -90,12 +84,25 @@ struct l2_packet_data * l2_packet_init(
         * TODO: open connection for receiving frames
         */
        l2->fd = -1;
-       eloop_register_read_sock(l2->fd, l2_packet_receive, l2, NULL);
+       if (l2->fd >= 0)
+               eloop_register_read_sock(l2->fd, l2_packet_receive, l2, NULL);
 
        return l2;
 }
 
 
+struct l2_packet_data * l2_packet_init_bridge(
+       const char *br_ifname, const char *ifname, const u8 *own_addr,
+       unsigned short protocol,
+       void (*rx_callback)(void *ctx, const u8 *src_addr,
+                           const u8 *buf, size_t len),
+       void *rx_callback_ctx, int l2_hdr)
+{
+       return l2_packet_init(br_ifname, own_addr, protocol, rx_callback,
+                             rx_callback_ctx, l2_hdr);
+}
+
+
 void l2_packet_deinit(struct l2_packet_data *l2)
 {
        if (l2 == NULL)
@@ -121,3 +128,10 @@ void l2_packet_notify_auth_start(struct l2_packet_data *l2)
 {
        /* This function can be left empty */
 }
+
+
+int l2_packet_set_packet_filter(struct l2_packet_data *l2,
+                               enum l2_packet_filter_type type)
+{
+       return -1;
+}