14 unsigned short attr; /* attribute code */
15 unsigned short size; /* attribute size */
16 void *data; /* attribute data */
21 struct attr* newAttr (unsigned short attr, unsigned short size, void *data);
24 static inline struct attr* newEmptyAttr (unsigned short attr)
26 return newAttr(attr, 0, NULL);
30 static inline struct attr* newByteAttr (unsigned short attr, unsigned char value)
32 char *v = malloc(sizeof(char));
36 return newAttr(attr, sizeof(char), v);
40 static inline struct attr* newShortAttr (unsigned short attr, short value)
42 short *v = malloc(sizeof(short));
46 return newAttr(attr, sizeof(short), v);
50 static inline struct attr* newIntAttr (unsigned short attr, int value)
52 int *v = malloc(sizeof(int));
56 return newAttr(attr, sizeof(int), v);
60 static inline struct attr* newAddrAttr (unsigned short attr, struct in_addr value)
62 struct in_addr *v = malloc(sizeof(struct in_addr));
66 return newAttr(attr, sizeof(struct in_addr), v);
70 void freeAttr (struct attr *at);
73 void filterAttributes (List *attr, ...);