15 unsigned short attr; /* attribute code */
16 unsigned short size; /* attribute size */
17 void *data; /* attribute data */
22 struct attr* newAttr (unsigned short attr, unsigned short size, void *data);
25 static inline struct attr* newEmptyAttr (unsigned short attr)
27 return newAttr(attr, 0, NULL);
31 static inline struct attr* newByteAttr (unsigned short attr, unsigned char value)
33 char *v = malloc(sizeof(char));
37 return newAttr(attr, sizeof(char), v);
41 static inline struct attr* newShortAttr (unsigned short attr, short value)
43 short *v = malloc(sizeof(short));
47 return newAttr(attr, sizeof(short), v);
51 static inline struct attr* newIntAttr (unsigned short attr, int value)
53 int *v = malloc(sizeof(int));
57 return newAttr(attr, sizeof(int), v);
61 static inline struct attr* newAddrAttr (unsigned short attr, struct in_addr value)
63 struct in_addr *v = malloc(sizeof(struct in_addr));
67 return newAttr(attr, sizeof(struct in_addr), v);
71 void freeAttr (struct attr *at);
74 void filterAttributes (List *attr, ...);