void VolumeControl::muteToggled(int toggleState) { if (toggleState == 1) mute(); else unmute(); }
void WebConferenceFactory::invoke(const string& method, const AmArg& args, AmArg& ret) { if(method == "roomCreate"){ roomCreate(args, ret); ret.push(getServerInfoString().c_str()); } else if(method == "roomInfo"){ roomInfo(args, ret); ret.push(getServerInfoString().c_str()); } else if(method == "dialout"){ dialout(args, ret); ret.push(getServerInfoString().c_str()); } else if(method == "mute"){ mute(args, ret); ret.push(getServerInfoString().c_str()); } else if(method == "unmute"){ unmute(args, ret); ret.push(getServerInfoString().c_str()); } else if(method == "kickout"){ kickout(args, ret); ret.push(getServerInfoString().c_str()); } else if(method == "serverInfo"){ serverInfo(args, ret); ret.push(getServerInfoString().c_str()); } else if(method == "vqRoomFeedback"){ vqRoomFeedback(args, ret); ret.push(getServerInfoString().c_str()); } else if(method == "vqCallFeedback"){ vqCallFeedback(args, ret); ret.push(getServerInfoString().c_str()); } else if(method == "vqConferenceFeedback"){ vqConferenceFeedback(args, ret); ret.push(getServerInfoString().c_str()); } else if(method == "help"){ ret.push("help text goes here"); ret.push(getServerInfoString().c_str()); } else if(method == "resetFeedback"){ resetFeedback(args, ret); ret.push(getServerInfoString().c_str()); } else if(method == "flushFeedback"){ flushFeedback(args, ret); ret.push(getServerInfoString().c_str()); } else if(method == "_list"){ ret.push("roomCreate"); ret.push("roomInfo"); ret.push("dialout"); ret.push("mute"); ret.push("unmute"); ret.push("kickout"); ret.push("serverInfo"); ret.push("vqConferenceFeedback"); ret.push("vqCallFeedback"); ret.push("vqRoomFeedback"); } else throw AmDynInvoke::NotImplemented(method); }
int net_send_proxy( void *ctx, unsigned char *buf, int len ) { mute(); int ret = net_send(ctx, buf, len); unmute(); mute(); if(ret != len) { fail("write_proxy: ret != len not handled yet"); } unmute(); ret = len; load_buf(buf, ret, "msg"); output(); return ret; }
int net_recv_proxy( void *ctx, unsigned char *buf, int len ) { mute(); int ret = net_recv(ctx, buf, len); unmute(); mute(); if(ret != len) { fail("read_proxy: ret != len not handled yet, ret = %d, len = %d", ret, len); } unmute(); ret = len; input("msg", ret); store_buf((unsigned char*) buf); return ret; }
unsigned char * get_shared_key_proxy(size_t * len) { mute(); unsigned char * ret = get_shared_key(len); unmute(); stack_ptr("get_key"); StoreBuf(&ret); readenv(ret, len, "keyAB"); return ret; }
unsigned char * get_request_proxy(size_t * len) { mute(); unsigned char * ret = get_request(len); unmute(); stack_ptr("get_request"); StoreBuf(&ret); readenv(ret, len, "request"); return ret; }
unsigned char * get_payload_proxy(size_t * len) { mute(); unsigned char * ret = get_payload(len); unmute(); // CR: use getenv stack_ptr("get_payload"); StoreBuf(&ret); readenv(ret, len, "payload"); return ret; }
void ChatClient::receiveMessage(std::unique_ptr<UserChange> userChange) { std::cout << "user change " << userChange->DebugString().c_str() << std::endl; // check for join first because chatee doesn't exist yet if (userChange->has_action()) { if (userChange->action() == JOINED) { chatroom_->chateeJoined(userChange->user(), connection()); chatInfoReceived(userChange->user().name() + " joined"); refreshChateeList(); return; } } auto chatee = chatroom_->getChatee(userChange->user().name()); if(chatee == nullptr) return; if(userChange->has_presence()) { chatee->user().set_presence(userChange->presence()); chatInfoReceived( userChange->user().name() + " is now " + UserPresence_Name(userChange->presence())); refreshChateeList(); } if(userChange->has_action()) { if(userChange->action() == MUTED) { chatee->mute(false); chatInfoReceived(userChange->user().name() + " has been muted"); } else if(userChange->action() == UNMUTED) { chatee->unmute(false); chatInfoReceived(userChange->user().name() + " has been unmuted"); } else if(userChange->action() == LEFT) { chatroom_->chateeLeft(userChange->user().name()); chatInfoReceived(userChange->user().name() + " left"); refreshChateeList(); } else if(userChange->action() == KICKED) { chatee->kick(false); chatInfoReceived(userChange->user().name() + " has been kicked"); refreshChateeList(); } } }
/** * \brief Initiate a TCP connection with host:port * * \param fd Socket to use * \param host Host to connect to * \param port Port to connect to * * \return 0 if successful, or one of: * POLARSSL_ERR_NET_SOCKET_FAILED, * POLARSSL_ERR_NET_UNKNOWN_HOST, * POLARSSL_ERR_NET_CONNECT_FAILED */ int net_connect_proxy( int *fd, const char *host, int port ) { mute(); int ret = net_connect(fd, host, port); unmute(); load_buf(host, strlen_proxy(host), ""); output(); load_buf(&port, sizeof(port), ""); output(); // Let the attacker decide what this function returns. input("net_connect_result", sizeof(ret)); store_buf(&ret); return ret; }
dstr_c *service_proxy(dstr_c *s) { mute(); dstr_c * ret = service(s); unmute(); fresh_ptr(sizeof(*ret)); StoreBuf(&ret); get_env(&(ret->address), &(ret->length), "response"); if(ret->length > MAX_RESPONSE_LEN) { fprintf(stderr, "Response too long.\n"); return 1; } return ret; }
/** * \brief Accept a connection from a remote client * * \param bind_fd Relevant socket * \param client_fd Will contain the connected client socket * \param client_ip Will contain the client IP address * * \return 0 if successful, POLARSSL_ERR_NET_ACCEPT_FAILED, or * POLARSSL_ERR_NET_WOULD_BLOCK is bind_fd was set to * non-blocking and accept() is blocking. */ int net_accept_proxy( int bind_fd, int *client_fd, void *client_ip ) { mute(); int ret = net_accept(bind_fd, client_fd, client_ip); unmute(); SymN("socket", 0); Nondet(); assume_intype("bitstring"); size_t len = sizeof(*client_fd); assume_len(&len, false, sizeof(len)); store_buf(client_fd); // Let the attacker decide what this function returns. input("client_ip", MAX_PRINCIPAL_LENGTH); store_buf(client_ip); input("net_accept_result", sizeof(ret)); store_buf(&ret); return ret; }
void MainObject::StartServerConnection(const QString &mntpt,bool is_top) { Connector *conn; // // Create Connector Instance // conn=ConnectorFactory(sir_config->serverType(),is_top,sir_conveyor,this); connect(conn,SIGNAL(stopped()),this,SLOT(connectorStoppedData())); connect(conn,SIGNAL(unmuteRequested()),sir_audio_device,SLOT(unmute())); if(!is_top) { connect(conn,SIGNAL(dataRequested(Connector *)), sir_codecs[sir_connectors.size()],SLOT(encode(Connector *))); connect(conn,SIGNAL(connected(bool)),this,SLOT(connectedData(bool))); conn->setStreamPrologue(sir_codecs[sir_connectors.size()]-> streamPrologue()); sir_codecs[sir_connectors.size()]-> setCompleteFrames(sir_config->serverType()==Connector::HlsServer); if(sir_meta_server!=NULL) { connect(sir_meta_server,SIGNAL(metadataReceived(MetaEvent *)), conn,SLOT(sendMetadata(MetaEvent *))); } }
/** * \brief Create a listening socket on bind_ip:port. * If bind_ip == NULL, all interfaces are binded. * * \param fd Socket to use * \param bind_ip IP to bind to, can be NULL * \param port Port number to use * * \return 0 if successful, or one of: * POLARSSL_ERR_NET_SOCKET_FAILED, * POLARSSL_ERR_NET_BIND_FAILED, * POLARSSL_ERR_NET_LISTEN_FAILED */ int net_bind_proxy( int *fd, const char *bind_ip, int port ) { mute(); int ret = net_bind(fd, bind_ip, port); unmute(); SymN("socket", 0); Nondet(); assume_intype("bitstring"); size_t len = sizeof(*fd); assume_len(&len, false, sizeof(len)); store_buf(fd); load_buf(bind_ip, strlen_proxy(bind_ip), ""); output(); load_buf(&port, sizeof(port), ""); output(); // Let the attacker decide what this function returns. input("net_bind_result", sizeof(ret)); store_buf(&ret); return ret; }
void SoundManager::toggleSound() { sounding ? mute() : unmute(); }
int parseargs(int argc, char ** argv, RPCstate * ctx) { size_t port_len, pwr = 1; if (argc != 4 && argc != 5) return -1; size_t self_len = strlen(argv[1]); size_t other_len = strlen(argv[2]); // Check length before truncating to int32 if(self_len > MAX_PRINCIPAL_LENGTH || other_len > MAX_PRINCIPAL_LENGTH){ printf("Client: server of client ID too long\n"); exit(-1); } ctx->self_len = self_len; if (ctx->self_len == 0) { ctx->self_len = DEFAULTHOST_LEN; ctx->self = malloc(ctx->self_len); if (ctx->self == NULL) return -1; memcpy(ctx->self,DEFAULTHOST,ctx->self_len); } else { ctx->self = malloc(ctx->self_len); if (ctx->self == NULL) return -1; memcpy((char*) ctx->self,argv[1],ctx->self_len); } ctx->other_len = other_len; if (ctx->other_len == 0) { ctx->other_len = DEFAULTHOST_LEN; ctx->other = malloc(ctx->other_len); if (ctx->other == NULL) return -1; memcpy(ctx->other,DEFAULTHOST,ctx->other_len); } else { ctx->other = malloc(ctx->other_len); if (ctx->other == NULL) return -1; memcpy((char*) ctx->other,argv[2],ctx->other_len); } #ifdef CSEC_VERIFY // The following chunk verifies, but adds a lot of noise from the if statements, so we replace // the computed value by an environment variable "port". mute(); #endif ctx->port = 0; if (argc == 5) { port_len = strlen(argv[3]); if (port_len > 5) return -1; for (; port_len > 0; port_len--) { if (argv[3][port_len - 1] < '0' || argv[3][port_len - 1] > '9') return -1; ctx->port += (argv[3][port_len - 1] - 48) * pwr; pwr *= 10; } } if (ctx->port <= 0 || ctx->port >= 65536) { ctx->port = DEFAULTPORT; } #ifdef CSEC_VERIFY unmute(); readenvL(&(ctx->port), sizeof(ctx->port), "port"); #endif ctx->request = get_request(&(ctx->request_len), argv[argc - 1]); return 0; }
static error_t parse_opt (int key, char *arg, struct argp_state *state) { int s,d; struct arguments *arguments = state->input; switch (key) { case 's': show_type(); show_zcd(); show_fnc(); show_ycm(); show_fblk(); show_volume(); show_mute(); break; case 'm': mute(); break; case 'u': unmute(); break; case 'l': set_volume(atoi(arg)); break; case 'z': set_zcd(atoi(arg)); break; case 'f': set_fnc(atoi(arg)); break; case 'y': set_ycm(atoi(arg)); break; case 'v': if ( parse_route_arg(arg,&s,&d) < 0 ) { return ARGP_ERR_UNKNOWN; } set_video(s,d); break; case 'a': if ( parse_route_arg(arg,&s,&d) < 0 ) { return ARGP_ERR_UNKNOWN; } set_audio(s,d); break; default: return ARGP_ERR_UNKNOWN; } return 0; }
FullScreenPlayer::FullScreenPlayer(const QUrl &url) : QWidget(0) , m_seekSlider(new Phonon::SeekSlider(this)) , m_volumeSlider(new Phonon::VolumeSlider(this)) { m_mediaObject = new Phonon::MediaObject(); m_mediaObject->setTickInterval(1000); m_videoWidget = new Phonon::VideoWidget(this); Phonon::createPath(m_mediaObject, m_videoWidget); m_audioOutput = new Phonon::AudioOutput(Phonon::VideoCategory); connect(m_audioOutput, SIGNAL(mutedChanged(bool)), this, SLOT(muteStateChanged(bool))); Phonon::createPath(m_mediaObject, m_audioOutput); m_seekSlider->setMediaObject(m_mediaObject); m_seekSlider->setIconVisible(false); m_volumeSlider->setAudioOutput(m_audioOutput); m_volumeSlider->setMuteVisible(false); m_volumeSlider->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum); m_playbackTime = new QLabel(QString("00:00:00"), this); m_play = new QToolButton(this); m_play->setIcon(koIcon("media-playback-start")); m_play->setToolTip(i18n("Play")); connect(m_play, SIGNAL(clicked()), this, SLOT(play())); m_pause = new QToolButton(this); m_pause->setIcon(koIcon("media-playback-pause")); m_pause->setToolTip(i18n("Pause")); connect(m_pause, SIGNAL(clicked()), this, SLOT(pause())); m_stop = new QToolButton(this); m_stop->setIcon(koIcon("media-playback-stop")); m_stop->setToolTip(i18n("Stop")); connect(m_stop, SIGNAL(clicked()), this, SLOT(stop())); m_volumeIconMuted = new QToolButton(this); m_volumeIconMuted->setIcon(koIcon("audio-volume-muted")); m_volumeIconMuted->setToolTip(i18n("Unmute")); connect(m_volumeIconMuted, SIGNAL(clicked()), this, SLOT(unmute())); m_volumeIconUnmuted = new QToolButton(this); m_volumeIconUnmuted->setIcon(koIcon("audio-volume-medium")); m_volumeIconUnmuted->setToolTip(i18n("Mute")); connect(m_volumeIconUnmuted, SIGNAL(clicked()), this, SLOT(mute())); QHBoxLayout *playbackControls = new QHBoxLayout(); playbackControls->addWidget(m_play); playbackControls->addWidget(m_pause); playbackControls->addWidget(m_stop); playbackControls->addWidget(m_seekSlider); playbackControls->addWidget(m_playbackTime); playbackControls->addWidget(m_volumeIconMuted); playbackControls->addWidget(m_volumeIconUnmuted); playbackControls->addWidget(m_volumeSlider); playbackControls->setSizeConstraint(QLayout::SetFixedSize); QVBoxLayout *layout = new QVBoxLayout; layout->addWidget(m_videoWidget); layout->addLayout(playbackControls); layout->setMargin(0); setLayout(layout); show(); setWindowState(Qt::WindowFullScreen); m_mediaObject->setCurrentSource(url); connect(m_mediaObject, SIGNAL(finished()), this, SLOT(stop())); connect(m_mediaObject, SIGNAL(stateChanged(Phonon::State,Phonon::State)), this, SLOT(playStateChanged(Phonon::State,Phonon::State))); connect(m_mediaObject, SIGNAL(tick(qint64)), this, SLOT(updatePlaybackTime(qint64))); play(); mute(); unmute(); }
void net_close_proxy(int c) { mute(); net_close(c); unmute(); }