Thread: struct sockaddr_ll

  1. #1
    Registered User
    Join Date
    Aug 2009
    Posts
    192

    struct sockaddr_ll

    I was wondering how to pass this struct through a function since this is a linux struct im really lost for words how to do it in C because i get random errors when i do it and the only way i can successfully do it is
    Code:
    void FrameSend(struct sockaddr_ll socket_address, int sent, int length);
    But i read you shouldnt be able to do that with a struct in front of the sockaddr_ll
    if i try to put it in a header file the function i get
    EthServ.h:8: warning: ‘struct sockaddr_ll’ declared inside parameter list
    EthServ.h:8: warning: its scope is only this definition or declaration, which is probably not what you want

    if i take away the struct i get
    server.c:80: error: expected declaration specifiers or ‘...’ before ‘sockaddr_ll’

    Whats the deal?

  2. #2
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Code:
           #include <sys/socket.h>
           #include <netpacket/packet.h>
           #include <net/ethernet.h>     /* the L2 protocols */
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. help with structs and malloc!
    By coni in forum C Programming
    Replies: 20
    Last Post: 09-14-2009, 05:38 PM
  2. Replies: 1
    Last Post: 12-03-2008, 03:10 AM
  3. Replies: 10
    Last Post: 05-18-2006, 11:23 PM
  4. What's wrong with my search program?
    By sherwi in forum C Programming
    Replies: 5
    Last Post: 04-28-2006, 09:57 AM
  5. what does this mean to you?
    By pkananen in forum C++ Programming
    Replies: 8
    Last Post: 02-04-2002, 03:58 PM