Sponsored Content
Top Forums Programming Implementing function outside struct Post 302598765 by jim mcnamara on Wednesday 15th of February 2012 11:03:18 AM
Old 02-15-2012
What you want: function pointers. Create a function pointer as an element of the struct.


The Function Pointer Tutorials - Index
 

10 More Discussions You Might Find Interesting

1. Programming

Implementing the redirection

Hi all I am facing a problem with redirection. Its somewhat related to parsing. I am following the following steps. 1. take the command and tokenize it. 2. if redirection is there then give it to redirection unit 3. if pipe is there give it to piping unit. 4. do until the command ends ... (0 Replies)
Discussion started by: mobile01
0 Replies

2. Shell Programming and Scripting

Implementing Password

I am trying to implement a login screen to the following code how would i go about doing so. I have try to place the password in a variable using if statements which would usually work but as i have the system in a while loop i think i need to find another method. #!/bin/bash #Filename:... (4 Replies)
Discussion started by: warlock129
4 Replies

3. Shell Programming and Scripting

Help with implementing logging

I'm trying to add logging to an existing script which echos a number of lines to the screen. I've added a switch to the script that is going to suppress much of this output and put it in a file instead. The way I envisioned it was like this: $log would be set to either "" or the log files... (8 Replies)
Discussion started by: cheetobandito
8 Replies

4. UNIX for Advanced & Expert Users

problem with netfilter hook function struct skbuff *sock is null..

iam trying to built a firewall.so i have used netfilter for it. in function main_hook sock_buff is returning null and in my log file continuously "sock buff null" is printed plse help to solve this problem.. (using print_string iam printing strings on current terminal (terminal we ping)) ... (1 Reply)
Discussion started by: pavan6754
1 Replies

5. UNIX for Dummies Questions & Answers

How to access a struct within a struct?

Can someone tell me how to do this? Just a thought that entered my mind when learning about structs. First thought was: struct one { struct two; } struct two { three; } one->two->three would this be how you would access "three"? (1 Reply)
Discussion started by: unbelievable21
1 Replies

6. Shell Programming and Scripting

Need help in implementing logic

i have following input file... 00290002STDR000000000000000000000000000EOD END TRANSACTION ^@^@^@^@^@^@^@^@^@^@^@^@^ 00299998STDR070000000007000000000000000STANDING DEBITS ^@^@^@^@^@^@^@^@^@^@^@^@^... (1 Reply)
Discussion started by: sagarrd
1 Replies

7. Shell Programming and Scripting

converting from c struct to function

Hey Guys, I need your help where I have a C structure and I want it to be converted into corresponding function. Example: typedef struct { unsigned long LineNum; //1025-4032 unsigned short KeyNum; /*tbd*/ char Key; /*between 1-3*/... (1 Reply)
Discussion started by: skyos
1 Replies

8. Programming

Problem with implementing the times() function in C (struct tms times return zero/negative values)

Hello, i'm trying to implement the times() function and i'm programming in C. I'm using the "struct tms" structure which consists of the fields: The tms_utime structure member is the CPU time charged for the execution of user instructions of the calling process. The tms_stime structure... (1 Reply)
Discussion started by: g_p
1 Replies

9. Programming

Storing C++-struct in file - problem when adding new item in struct

Hi, I have received an application that stores some properties in a file. The existing struct looks like this: struct TData { UINT uSizeIncludingStrings; // copy of Telnet data struct UINT uSize; // basic properties: TCHAR szHost; //defined in Sshconfig UINT iPortNr; TCHAR... (2 Replies)
Discussion started by: Powerponken
2 Replies

10. Shell Programming and Scripting

Implementing Listagg like function in shell

Hi, Basically what I am trying to do is making multiple fields of the same type comma-separated. i.e. for a data like this: B00000 abc B00001 abc,def B00001 ghi B00001 jkl B00002 abc B00002 def B00003 xyz Output should be like: B00000 abc B00001 abc,def,ghi,jkl... (20 Replies)
Discussion started by: prohank
20 Replies
ETHERSUBR(9)						   BSD Kernel Developer's Manual					      ETHERSUBR(9)

NAME
ethersubr, ether_ifattach, ether_addmulti, ether_delmulti, ETHER_FIRST_MULTI, ETHER_NEXT_MULTI, ETHER_IS_MULTICAST, fddi_ifattach, fddi_addmulti, fddi_delmulti -- Ethernet and FDDI driver support functions and macros SYNOPSIS
#include <net/if_ether.h> void ether_ifattach(struct ifnet *ifp, uint8_t *lla); int ether_addmulti(const struct sockaddr *sa, struct ethercom *ec); int ether_delmulti(const struct sockaddr *sa, struct ethercom *ec); void ETHER_FIRST_MULTI(struct ether_multistep step, struct ethercom *ec, struct ether_multi *enm); void ETHER_NEXT_MULTI(struct ether_multistep step, struct ether_multi *enm); int ETHER_IS_MULTICAST(uint8_t *addr); #include <net/if_fddi.h> void fddi_ifattach(struct ifnet *ifp, uint8_t *lla); int fddi_addmulti(const struct sockaddr *sa, struct ethercom *ec); int fddi_delmulti(const struct sockaddr *sa, struct ethercom *ec); DESCRIPTION
The ethersubr functions provide the interface between the ethersubr module and the network drivers which need Ethernet support. Such drivers must request the ether attribute in their files declaration and call the appropriate functions as specified below. FDDI drivers must request the "fddi" attribute in their "files" declaration and call the functions tagged with "fddi_" or "FDDI_" instead, where different. Some macros are shared. Note that you also need the arp(9) stuff to support IPv4 on your hardware. ether_ifattach(ifp, lla) Perform the device-independent, but Ethernet-specific initialization of the interface pointed to by ifp. Among other duties, this function creates a record for the link level address in the interface's address list and records the link level address pointed to by lla there. This function must be called from the driver's attach function. fddi_ifattach(ifp, lla) Corresponding function for FDDI devices. ether_addmulti(sa, ec) ether_delmulti(sa, ec) Add (ether_addmulti()) or delete (ether_delmulti()) the address described by the sa pointer to the Ethernet multicast list belonging to ec. These functions must be called from the driver's ioctl function to handle SIOCADDMULTI and SIOCDELMULTI requests. If these return ENETRESET, the hardware multicast filter must be reinitialized. These functions accept AF_UNSPEC addresses, which are interpreted as Ethernet addresses, or AF_INET addresses. In the latter case, INADDR_ANY is mapped to a range describing all the Ethernet address space reserved for IPv4 multicast addresses. The ether_addmulti() returns EAFNOSUPPORT if an unsupported address family is specified, EINVAL if a non-multicast address is speci- fied, or ENETRESET if the multicast list really changed and the driver should synchronize its hardware filter with it. The ether_delmulti() returns, in addition to the above errors, ENXIO if the specified address can't be found in the list of multi- cast addresses. fddi_addmulti(sa, ec) fddi_delmulti(sa, ec) Corresponding functions for FDDI devices. ETHER_NEXT_MULTI(step, enm) A macro to step through all of the ether_multi records, one at a time. The current position is remembered in step, which the caller must provide. ETHER_FIRST_MULTI(step, ec, enm) A macro that must be called to initialize step and get the first record. Both macros return a NULL enm when there are no remaining records. ETHER_IS_MULTICAST(addr) A macro that returns 1, if addr points to an Ethernet/FDDI multicast (or broadcast) address. SEE ALSO
arp(9) HISTORY
Rewritten to attach to the new ARP system in NetBSD 1.3. AUTHORS
UCB CSRG (original implementation) Ignatios Souvatzis (support for new ARP system) CODE REFERENCES
Ethernet support functions are declared in <net/if_ether.h> and defined (if not implemented as macro) in sys/net/if_ethersubr.c. FDDI support functions are declared in <net/if_fddi.h> and defined (if not implemented as macro) in sys/net/if_fddisubr.c. BSD
March 3, 1997 BSD
All times are GMT -4. The time now is 08:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy