001    package dk.i1.sctp;
002    import java.net.InetSocketAddress;
003    import java.net.InetAddress;
004    
005    public class SCTPNotificationPeerAddressChange extends SCTPNotification {
006            public final InetSocketAddress spc_aaddr;
007            public static final int SCTP_ADDR_AVAILABLE = 1;
008            public static final int SCTP_ADDR_UNREACHABLE = 2;
009            public static final int SCTP_ADDR_REMOVED = 3;
010            public static final int SCTP_ADDR_ADDED = 4;
011            public static final int SCTP_ADDR_MADE_PRIM = 5;
012            public static final int SCTP_ADDR_CONFIRMED = 6;
013            public final int spc_state;
014            public final int spc_error;
015            AssociationId spc_assoc_id;
016            SCTPNotificationPeerAddressChange(short flags,
017                                              byte[] spc_aaddr_addr,
018                                              int spc_aaddr_port,
019                                              int spc_state,
020                                              int spc_error,
021                                              long spc_assoc_id) throws Exception
022            {
023                    super(flags,Type.SCTP_PEER_ADDR_CHANGE);
024                    this.spc_aaddr = new InetSocketAddress(InetAddress.getByAddress(spc_aaddr_addr),spc_aaddr_port);
025                    this.spc_state = spc_state;
026                    this.spc_error = spc_error;
027                    this.spc_assoc_id = new AssociationId(spc_assoc_id);
028            }
029    }