pe2.c 731 B

1234567891011121314151617181920212223242526272829303132333435
  1. #include <linux/in.h>
  2. #include <linux/mm.h>
  3. #include <linux/module.h>
  4. #include <linux/netdevice.h>
  5. #include <linux/skbuff.h>
  6. #include <linux/slab.h>
  7. #include <net/datalink.h>
  8. static int pEII_request(struct datalink_proto *dl,
  9. struct sk_buff *skb, unsigned char *dest_node)
  10. {
  11. struct net_device *dev = skb->dev;
  12. skb->protocol = htons(ETH_P_IPX);
  13. dev_hard_header(skb, dev, ETH_P_IPX, dest_node, NULL, skb->len);
  14. return dev_queue_xmit(skb);
  15. }
  16. struct datalink_proto *make_EII_client(void)
  17. {
  18. struct datalink_proto *proto = kmalloc(sizeof(*proto), GFP_ATOMIC);
  19. if (proto) {
  20. proto->header_length = 0;
  21. proto->request = pEII_request;
  22. }
  23. return proto;
  24. }
  25. void destroy_EII_client(struct datalink_proto *dl)
  26. {
  27. kfree(dl);
  28. }