- SPRINT(interface_error, "Error in %s (line %d): parameter '%s' not implemented yet.\n", filename, line, parameter);
- return(-1);
+ struct interface_port *ifport, **ifportp;
+ struct interface *searchif;
+
+ /* check for port already assigned */
+ searchif = interface_newlist;
+ while(searchif)
+ {
+ ifport = searchif->ifport;
+ while(ifport)
+ {
+ if (!strcasecmp(ifport->portname, value))
+ {
+ SPRINT(interface_error, "Error in %s (line %d): port '%s' already used above.\n", filename, line, value);
+ return(-1);
+ }
+ ifport = ifport->next;
+ }
+ searchif = searchif->next;
+ }
+ /* alloc port substructure */
+ ifport = (struct interface_port *)MALLOC(sizeof(struct interface_port));
+ memuse++;
+ ifport->interface = interface;
+ /* set value */
+ ifport->portnum = -1; // disable until resolved
+ SCPY(ifport->portname, value);
+ /* tail port */
+ ifportp = &interface->ifport;
+ while(*ifportp)
+ ifportp = &((*ifportp)->next);
+ *ifportp = ifport;
+ return(0);